diff options
-rw-r--r-- | bridge.go | 7 | ||||
-rw-r--r-- | bridge_test.go | 7 | ||||
-rw-r--r-- | light.go | 13 | ||||
-rw-r--r-- | light_test.go | 9 |
4 files changed, 33 insertions, 3 deletions
@@ -1,3 +1,10 @@ +/* +* bridge.go +* GoHue library for Philips Hue +* Copyright (C) 2016 Collin Guarino (Collinux) +* License: GPL version 2 or higher http://www.gnu.org/licenses/gpl.html +*/ + package hue import ( diff --git a/bridge_test.go b/bridge_test.go index b9b0137..ddf2ae6 100644 --- a/bridge_test.go +++ b/bridge_test.go @@ -1,3 +1,10 @@ +/* +* bridge_test.go +* GoHue library for Philips Hue +* Copyright (C) 2016 Collin Guarino (Collinux) +* License: GPL version 2 or higher http://www.gnu.org/licenses/gpl.html +*/ + package hue import ( @@ -1,5 +1,11 @@ -// http://www.developers.meethue.com/documentation/lights-api +/* +* light.go +* GoHue library for Philips Hue +* Copyright (C) 2016 Collin Guarino (Collinux) +* License: GPL version 2 or higher http://www.gnu.org/licenses/gpl.html +*/ +// http://www.developers.meethue.com/documentation/lights-api package hue import ( @@ -56,7 +62,10 @@ func (self *Light) SetName(name string) error { body := make(map[string]string) body["name"] = name _, _, err := self.Bridge.Put(uri, body) - return err + if err != nil { + return err + } + return nil } // Light.Off will turn the light source off diff --git a/light_test.go b/light_test.go index 20ab4b8..cf57c94 100644 --- a/light_test.go +++ b/light_test.go @@ -1,3 +1,10 @@ +/* +* light_test.go +* GoHue library for Philips Hue +* Copyright (C) 2016 Collin Guarino (Collinux) +* License: GPL version 2 or higher http://www.gnu.org/licenses/gpl.html +*/ + package hue import ( @@ -30,5 +37,5 @@ func TestSetLightState(t *testing.T) { time.Sleep(time.Second) selectedLight.ColorLoop() - selectedLight.SetName("testing") + selectedLight.SetName("Ceiling Fan Outer") } |