amimof / huego

An extensive Philips Hue client library for Go with an emphasis on simplicity
MIT License
250 stars 36 forks source link

Bug: setting bright will not effect state on #38

Closed willie68 closed 3 years ago

willie68 commented 3 years ago

This is a little bug. The light is off. If you set the brightness to 254 for a light, the light will be switched on, but the State will remain off. So, this code will never work...

if light.IsOn() {
  light.Off()
} else {
  light.Bri(254)
}

problem seems to be that the BriContext Method on the light object will not parse the response of the bridge. NOr does it directly change to state.on parameter. (Because it's not possible to set the bri to a light with state off...)

willie68 commented 3 years ago

Same for Hue, Sat, Xy, Ct...