aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bridge.go7
-rw-r--r--bridge_test.go7
-rw-r--r--light.go13
-rw-r--r--light_test.go9
4 files changed, 33 insertions, 3 deletions
diff --git a/bridge.go b/bridge.go
index e66432a..ae480a4 100644
--- a/bridge.go
+++ b/bridge.go
@@ -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 (
diff --git a/light.go b/light.go
index cc8a112..5c975cc 100644
--- a/light.go
+++ b/light.go
@@ -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")
}