aboutsummaryrefslogtreecommitdiff
path: root/light.go
diff options
context:
space:
mode:
authorCollin Guarino <collin.guarino@gmail.com>2016-02-08 22:25:17 -0500
committerCollin Guarino <collin.guarino@gmail.com>2016-02-08 22:25:17 -0500
commit2f3b850a28e8d6640a063ca238a56dd9550e654c (patch)
tree87ef07786ce6fcb44f1a647063fdfea57a8e1655 /light.go
parente7deedcd248dbc89623db252dcf2b0559d944abb (diff)
Fixed light on/off toggle to return error.
Diffstat (limited to 'light.go')
-rw-r--r--light.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/light.go b/light.go
index b62fec4..0caca2e 100644
--- a/light.go
+++ b/light.go
@@ -62,11 +62,11 @@ func (self *Light) On() error {
}
// light.Toggle will toggle the light source on and off
-func (self *Light) Toggle() {
+func (self *Light) Toggle() error {
if self.State.On {
- self.Off()
+ return self.Off()
} else {
- self.On()
+ return self.On()
}
}