diff options
author | Collin Guarino <collin.guarino@gmail.com> | 2016-02-16 00:29:26 -0500 |
---|---|---|
committer | Collin Guarino <collin.guarino@gmail.com> | 2016-02-16 00:29:26 -0500 |
commit | f80f7c49e63ddbb1acb7dd365820c84e75ae1a30 (patch) | |
tree | a279af648915b4d11b079a8b6d1b29aa9f26fef7 | |
parent | 699afeb32d1936d059bcbe8a092a142c523819cc (diff) |
Changed documentation header standard project wide to a less passive voice.
-rw-r--r-- | bridge.go | 10 | ||||
-rw-r--r-- | group.go | 2 | ||||
-rw-r--r-- | light.go | 24 | ||||
-rw-r--r-- | scene.go | 4 | ||||
-rw-r--r-- | schedule.go | 4 |
5 files changed, 22 insertions, 22 deletions
@@ -55,7 +55,7 @@ type Device struct { UDN string `xml:"UDN"` } -// bridge.Get will send an http GET to the bridge +// bridge.Get sends an http GET to the bridge func (self *Bridge) Get(path string) ([]byte, io.Reader, error) { resp, err := http.Get("http://" + self.IPAddress + path) if self.Error(resp, err) { @@ -64,7 +64,7 @@ func (self *Bridge) Get(path string) ([]byte, io.Reader, error) { return HandleResponse(resp) } -// Bridge.Put will send an http PUT to the bridge with +// Bridge.Put sends an http PUT to the bridge with // a body formatted with parameters (in a generic interface) func (self *Bridge) Put(path string, params interface{}) ([]byte, io.Reader, error) { uri := fmt.Sprintf("http://" + self.IPAddress + path) @@ -85,7 +85,7 @@ func (self *Bridge) Put(path string, params interface{}) ([]byte, io.Reader, err return HandleResponse(resp) } -// bridge.Post will send an http POST to the bridge with +// bridge.Post sends an http POST to the bridge with // a body formatted with parameters (in a generic interface) func (self *Bridge) Post(path string, params interface{}) ([]byte, io.Reader, error) { // Add the params to the request @@ -105,7 +105,7 @@ func (self *Bridge) Post(path string, params interface{}) ([]byte, io.Reader, er return HandleResponse(resp) } -// Bridge.Delete will send an http DELETE to the bridge +// Bridge.Delete sends an http DELETE to the bridge func (self *Bridge) Delete(path string) error { uri := fmt.Sprintf("http://" + self.IPAddress + path) client := &http.Client{} @@ -195,7 +195,7 @@ func (bridge *Bridge) CreateUser(deviceType string) error { return nil } -// Bridge.DeleteUser will delete a user given its USER KEY, not the string name. +// Bridge.DeleteUser deletes a user given its USER KEY, not the string name. // See http://www.developers.meethue.com/documentation/configuration-api // for description on `username` deprecation in place of the devicetype key. func (bridge *Bridge) DeleteUser(username string) error { @@ -31,7 +31,7 @@ type Group struct { Type string `json:"type"` } -// Bridge.GetGroups get the attributes for each group of lights. +// Bridge.GetGroups gets the attributes for each group of lights. // TODO: NOT TESTED, NOT FULLY IMPLEMENTED func (bridge *Bridge) GetGroups() ([]Group, error) { uri := fmt.Sprintf("/api/%s/groups", bridge.Username) @@ -59,7 +59,7 @@ type LightState struct { Name string `json:"name,omitempty"` } -// Light.SetName will assign a new name in the light's +// Light.SetName assigns a new name in the light's // attributes as recognized by the bridge. func (self *Light) SetName(name string) error { uri := fmt.Sprintf("/api/%s/lights/%d", self.Bridge.Username, self.Index) @@ -72,17 +72,17 @@ func (self *Light) SetName(name string) error { return nil } -// Light.Off will turn the light source off +// Light.Off turns the light source off func (self *Light) Off() error { return self.SetState(LightState{On: false}) } -// Light.Off will turn the light source on +// Light.Off turns the light source on func (self *Light) On() error { return self.SetState(LightState{On: true}) } -// Light.Toggle will toggle the light source on and off +// Light.Toggle switches the light source on and off func (self *Light) Toggle() error { if self.State.On { return self.Off() @@ -92,8 +92,8 @@ func (self *Light) Toggle() error { return nil } -// Light.Delete will remove the light from the list of -// lights available on the bridge. +// Light.Delete removes the light from the +// list of lights available on the bridge. func (self *Light) Delete() error { uri := fmt.Sprintf("/api/%s/lights/%d", self.Bridge.Username, self.Index) err := self.Bridge.Delete(uri) @@ -103,7 +103,7 @@ func (self *Light) Delete() error { return nil } -// Light.Blink will increase and decrease the brightness +// Light.Blink increases and decrease the brightness // repeatedly for a given seconds interval and return the // light back to its off or on state afterwards. // Note: time will vary based on connection speed and algorithm speed. @@ -141,8 +141,8 @@ func (self *Light) Blink(seconds int) error { return nil } -// Light.ColorLoop will set the light state to 'colorloop' if `active` -// is true or it will set the light state to "none" if `activate` is false. +// Light.ColorLoop sets the light state to 'colorloop' if `active` +// is true or it sets the light state to "none" if `activate` is false. func (self *Light) ColorLoop(activate bool) error { var state = "none" if activate { @@ -151,7 +151,7 @@ func (self *Light) ColorLoop(activate bool) error { return self.SetState(LightState{On: true, Effect: state}) } -// Light.SetState will modify light attributes. See `LightState` struct for attributes. +// Light.SetState modifyies light attributes. See `LightState` struct for attributes. // Brightness must be between 1 and 254 (inclusive) // Hue must be between 0 and 65535 (inclusive) // Sat must be between 0 and 254 (inclusive) @@ -186,7 +186,7 @@ func GetAllLights(bridge *Bridge) ([]Light, error) { return lights, nil } -// GetLightByIndex will return a light struct containing data on +// GetLightByIndex returns a light struct containing data on // a light given its index stored on the bridge. This is used for // quickly updating an individual light. func GetLightByIndex(bridge *Bridge, index int) (Light, error) { @@ -211,7 +211,7 @@ func GetLightByIndex(bridge *Bridge, index int) (Light, error) { return light, nil } -// GetLight will return a light struct containing data on a given name. +// GetLight returns a light struct containing data on a given name. func GetLightByName(bridge *Bridge, name string) (Light, error) { lights, _ := GetAllLights(bridge) for _, light := range lights { @@ -30,7 +30,7 @@ type Scene struct { ID string `json:",omitempty"` } -// Bridge.GetScenes will get attributes for all scenes. +// Bridge.GetScenes gets the attributes for all scenes. func (bridge *Bridge) GetAllScenes() ([]Scene, error) { uri := fmt.Sprintf("/api/%s/scenes", bridge.Username) body, _, err := bridge.Get(uri) @@ -53,7 +53,7 @@ func (bridge *Bridge) GetAllScenes() ([]Scene, error) { return scenesList, nil } -// Bridge.GetScene will get the attributes for an individual scene. +// Bridge.GetScene gets 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) { diff --git a/schedule.go b/schedule.go index 5097c79..5f9ca38 100644 --- a/schedule.go +++ b/schedule.go @@ -32,7 +32,7 @@ type Schedule struct { ID string } -// Bridge.GetAllSchedules will get Alarms and Timers in a Schedule struct. +// Bridge.GetAllSchedules gets Alarms and Timers in a Schedule struct. func (bridge *Bridge) GetAllSchedules() ([]Schedule, error) { uri := fmt.Sprintf("/api/%s/schedules", bridge.Username) body, _, err := bridge.Get(uri) @@ -57,7 +57,7 @@ func (bridge *Bridge) GetAllSchedules() ([]Schedule, error) { return scheduleList, nil } -// Bridge.GetSchedule will get the attributes for an individual schedule. +// Bridge.GetSchedule gets the attributes for an individual schedule. // 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) { |