smrtnt / Arilux_AL-LC0X

Alternative firmware for Arilux AL-LC0X LED controllers, based on the MQTT protocol and a TLS connection
MIT License
190 stars 33 forks source link

Wrong state when turning device on with a color command #21

Closed alexschwantes closed 7 years ago

alexschwantes commented 7 years ago

When the device is off. if you send just a color command via json/mqtt such as follows, it will turn on the light to the specified color but the state that is returned is OFF, instead of ON. The same happens if you use the IR remote...

SET: { 'color': {'r':0, 'g':255, 'b':0}}
STATE: {"state":"OFF","brightness":145,"white_value":0,"color":{"r":0,"g":255,"b":0}}

Further in this state, you can't turn it off. you first have to send an ON command and then an OFF command to turn the device off. This is due to the checking of m_state variable on lines 57 and 60 of arilux.cpp.

alexschwantes commented 7 years ago

Sorry, the last commit should have read a fix for #20, not 21.