diff options
-rw-r--r-- | scene.go | 6 | ||||
-rw-r--r-- | schedule.go | 2 |
2 files changed, 6 insertions, 2 deletions
@@ -12,6 +12,7 @@ import ( "encoding/json" ) +// Scene struct defines attributes for Scene items type Scene struct { Appdata struct { Data string `json:"data"` @@ -29,7 +30,7 @@ type Scene struct { } // Bridge.GetScenes will get attributes for all scenes. -func (bridge *Bridge) GetScenes() ([]Scene, error) { +func (bridge *Bridge) GetAllScenes() ([]Scene, error) { uri := fmt.Sprintf("/api/%s/scenes", bridge.Username) body, _, err := bridge.Get(uri) if err != nil { @@ -53,6 +54,9 @@ func (bridge *Bridge) GetScenes() ([]Scene, error) { return scenesList, nil } +// Bridge.GetScene will get the attributes for an individual scene. +// This is used to optimize time when updating the state of the scene. +// Note: The ID is not an index, it's a unique key generated for each scene. func (bridge *Bridge) GetScene(id string) (Scene, error) { uri := fmt.Sprintf("/api/%s/scenes/%s", bridge.Username, id) body, _, err := bridge.Get(uri) diff --git a/schedule.go b/schedule.go index c586e1d..fb0b4d3 100644 --- a/schedule.go +++ b/schedule.go @@ -57,7 +57,7 @@ func (bridge *Bridge) GetAllSchedules() ([]Schedule, error) { } // Bridge.GetSchedule will get the attributes for an individual schedule. -// This is used as to optimize time when updating the state of a schedule item. +// This is used to optimize time when updating the state of a schedule item. // Note: The ID is not an index, it's a unique key generated for each schedule. func (bridge *Bridge) GetSchedule(id string) (Schedule, error) { uri := fmt.Sprintf("/api/%s/schedules/%s", bridge.Username, id) |