From d676089ff95cef488963555e75929da20326f612 Mon Sep 17 00:00:00 2001 From: Collin Guarino Date: Sat, 13 Feb 2016 11:35:29 -0500 Subject: Cleaned up documentation and tests. --- light.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'light.go') 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) -- cgit v1.2.3