-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathscene.go
37 lines (33 loc) · 1.38 KB
/
scene.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package huego
import "context"
// Scene represents a bridge scene https://developers.meethue.com/documentation/scenes-api
type Scene struct {
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Group string `json:"group,omitempty"`
Lights []string `json:"lights,omitempty"`
Owner string `json:"owner,omitempty"`
Recycle bool `json:"recycle"`
Locked bool `json:"locked,omitempty"`
AppData interface{} `json:"appdata,omitempty"`
Picture string `json:"picture,omitempty"`
LastUpdated string `json:"lastupdated,omitempty"`
Version int `json:"version,omitempty"`
StoreLightState bool `json:"storelightstate,omitempty"`
LightStates map[int]State `json:"lightstates,omitempty"`
TransitionTime uint16 `json:"transitiontime,omitempty"`
ID string `json:"-"`
bridge *Bridge
}
// Recall will recall the scene in the group identified by id
func (s *Scene) Recall(id int) error {
return s.RecallContext(context.Background(), id)
}
// RecallContext will recall the scene in the group identified by id
func (s *Scene) RecallContext(ctx context.Context, id int) error {
_, err := s.bridge.RecallSceneContext(ctx, s.ID, id)
if err != nil {
return err
}
return nil
}