From fb14bbfab6d23cac1fc987a6190c11b41fadc4d7 Mon Sep 17 00:00:00 2001 From: Collin Guarino Date: Sun, 14 Feb 2016 23:15:03 -0500 Subject: Added documentation and changed Bridge.GetScenes to Bridge.GetAllScenes for clarification. --- scene.go | 6 +++++- schedule.go | 2 +- 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) -- cgit v1.2.3