Skip to content

Commit

Permalink
Turn off the bulb in updateColor if the brightness is set to 0
Browse files Browse the repository at this point in the history
This sets the power to false when the brightness if changed to 0,
this behavior differs from the LIFX app, which has a lower limit
on brightness of 1%.
  • Loading branch information
blubber committed Apr 2, 2016
1 parent d096770 commit a3e8716
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions hklifxd.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ func GetHKLight(light common.Light) *HKLight {
if (brightness > 0 && !currentPower) {
log.Printf("[INFO] Color changed for %s, turning on power.", label)
light.SetPowerDuration(true, transitionDuration)
} else if (brightness == 0 && currentPower) {
log.Printf("[INFO] Color changed for %s, but brightness = 0 turning off power.", label)
light.SetPower(false)
}
}

Expand Down

0 comments on commit a3e8716

Please sign in to comment.