mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-06 01:15:10 -06:00
add adaptive lighting service
This commit is contained in:
26
internal/services/adaptive_lighting.go
Normal file
26
internal/services/adaptive_lighting.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
ws "saml.dev/gome-assistant/internal/websocket"
|
||||
)
|
||||
|
||||
/* Structs */
|
||||
|
||||
type AdaptiveLighting struct {
|
||||
conn *ws.WebsocketWriter
|
||||
}
|
||||
|
||||
/* Public API */
|
||||
|
||||
// Set manual control for an adaptive lighting entity.
|
||||
func (al AdaptiveLighting) SetManualControl(entityId string, enabled bool) error {
|
||||
req := NewBaseServiceRequest("")
|
||||
req.Domain = "adaptive_lighting"
|
||||
req.Service = "set_manual_control"
|
||||
req.ServiceData = map[string]any{
|
||||
"entity_id": entityId,
|
||||
"manual_control": enabled,
|
||||
}
|
||||
|
||||
return al.conn.WriteMessage(req)
|
||||
}
|
||||
@@ -6,7 +6,8 @@ import (
|
||||
)
|
||||
|
||||
func BuildService[
|
||||
T AlarmControlPanel |
|
||||
T AdaptiveLighting |
|
||||
AlarmControlPanel |
|
||||
Climate |
|
||||
Cover |
|
||||
Light |
|
||||
|
||||
Reference in New Issue
Block a user