aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-02-14 23:15:03 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-02-14 23:15:03 -0500
commitfb14bbfab6d23cac1fc987a6190c11b41fadc4d7 (patch)
tree2e83343ab40f56123ad60905274a778f5929fc06
parentd5d85fa56a9ec8c44b3e7642586c3cd1fc3aa952 (diff)
Added documentation and changed Bridge.GetScenes to Bridge.GetAllScenes for clarification.
-rw-r--r--scene.go6
-rw-r--r--schedule.go2
2 files changed, 6 insertions, 2 deletions
diff --git a/scene.go b/scene.go
index 95fac29..06b754a 100644
--- a/scene.go
+++ b/scene.go
@@ -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)