All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.hassemble.extending.entities.actuators.light.Light.kt Maven / Gradle / Ivy

The newest version!
package hassemble.extending.entities.actuators.light

import hassemble.HomeAssistantApiClient
import hassemble.communicating.ServiceCommandResolver
import hassemble.entities.Attributes
import hassemble.entities.State
import hassemble.entities.devices.Actuator
import hassemble.extending.entities.Actuator
import hassemble.values.EntityId
import hassemble.values.FriendlyName
import hassemble.values.ObjectId
import hassemble.values.UserId
import hassemble.values.domain
import kotlinx.datetime.Instant
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Suppress("FunctionName")
internal inline fun , reified A : Attributes> HomeAssistantApiClient.Light(
    objectId: ObjectId,
    serviceCommandResolver: ServiceCommandResolver
): Actuator = Actuator(EntityId.fromPair("light".domain to objectId), serviceCommandResolver)

@Serializable
data class LightAttributes(
    @SerialName("supported_features")
    val supportedFeatures: Int,
    @SerialName("user_id")
    override val userId: UserId?,
    @SerialName("friendly_name")
    override val friendlyName: FriendlyName,
    @SerialName("last_changed")
    override val lastChanged: Instant,
    @SerialName("last_updated")
    override val lastUpdated: Instant
) : Attributes




© 2015 - 2024 Weber Informatics LLC | Privacy Policy