commonMain.hassemble.extending.entities.actuators.light.Light.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hassemble-jvm Show documentation
Show all versions of hassemble-jvm Show documentation
Interact with your Home Assistant server using Kotlin.
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