File tree Expand file tree Collapse file tree 3 files changed +30
-1
lines changed
Expand file tree Collapse file tree 3 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 1+ package services
2+
3+ import (
4+ ws "saml.dev/gome-assistant/internal/websocket"
5+ )
6+
7+ /* Structs */
8+
9+ type AdaptiveLighting struct {
10+ conn * ws.WebsocketWriter
11+ }
12+
13+ /* Public API */
14+
15+ // Set manual control for an adaptive lighting entity.
16+ func (al AdaptiveLighting ) SetManualControl (entityId string , enabled bool ) error {
17+ req := NewBaseServiceRequest ("" )
18+ req .Domain = "adaptive_lighting"
19+ req .Service = "set_manual_control"
20+ req .ServiceData = map [string ]any {
21+ "entity_id" : entityId ,
22+ "manual_control" : enabled ,
23+ }
24+
25+ return al .conn .WriteMessage (req )
26+ }
Original file line number Diff line number Diff line change 66)
77
88func BuildService [
9- T AlarmControlPanel |
9+ T AdaptiveLighting |
10+ AlarmControlPanel |
1011 Climate |
1112 Cover |
1213 Light |
Original file line number Diff line number Diff line change 66)
77
88type Service struct {
9+ AdaptiveLighting * services.AdaptiveLighting
910 AlarmControlPanel * services.AlarmControlPanel
1011 Climate * services.Climate
1112 Cover * services.Cover
@@ -31,6 +32,7 @@ type Service struct {
3132
3233func newService (conn * ws.WebsocketWriter ) * Service {
3334 return & Service {
35+ AdaptiveLighting : services.BuildService [services.AdaptiveLighting ](conn ),
3436 AlarmControlPanel : services.BuildService [services.AlarmControlPanel ](conn ),
3537 Climate : services.BuildService [services.Climate ](conn ),
3638 Cover : services.BuildService [services.Cover ](conn ),
You can’t perform that action at this time.
0 commit comments