aboutsummaryrefslogtreecommitdiff
path: root/light.go
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-02-13 11:35:29 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-02-13 11:35:29 -0500
commitd676089ff95cef488963555e75929da20326f612 (patch)
treeaa2e80a4f2db3dc31a5eb56ca4fe85c61df21fb4 /light.go
parent922e7290c37e46046b1a4e68818c77c44a192b2e (diff)
Cleaned up documentation and tests.
Diffstat (limited to 'light.go')
-rw-r--r--light.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/light.go b/light.go
index aab344b..e5f7874 100644
--- a/light.go
+++ b/light.go
@@ -24,7 +24,7 @@ type Light struct {
Hue int `json:"hue"` // Hue value 1-65535
Saturation int `json:"sat"` // Saturation value 0-254
Effect string `json:"effect"` // "None" or "Colorloop"
- XY [2]float32 `json:"xy"` // Coordinates of color in CIE color space
+ XY [2]float32 `json:"xy"` // Coordinates of color in CIE color space
CT int `json:"ct"` // Mired Color Temperature (google it)
Alert string `json:"alert"`
ColorMode string `json:"colormode"`
@@ -59,6 +59,8 @@ type LightState struct {
Name string `json:"name,omitempty"`
}
+// Light.SetName will assign 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)
body := make(map[string]string)