mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-06 09:15:12 -06:00
27 lines
557 B
Go
27 lines
557 B
Go
package services
|
|
|
|
import (
|
|
ws "github.com/Xevion/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)
|
|
}
|