toblum / McLighting

The ESP8266 based multi-client lighting gadget

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lights turned off by default after power failure?

guardiande opened this issue · comments

Hi,

Is it possible to have to lights turned off by default when the device recovers after a power loss?

Hi @guardiande,

the strip is initialied here:

strip->setColor(main_color.red, main_color.green, main_color.blue);

You may just set the color to 0,0,0 by default. That should work,

Hi @toblum,

Thanks for the quick response!

That does not work, since at the end of the setup function the strip configuration gets restored if enabled.

I added a initStrip() as the very last statement in the setup function, which did not help. After also adding a mode = OFF the strip does not power on after a power failure.

Yes, I was wrong. The function readStateFS() does the restoration of the saved values when powering up, so you may be able to override the standard behaviour here:

strip->setColor(main_color.red, main_color.green, main_color.blue);