thebigpotatoe / Super-Simple-RGB-WiFi-Lamp

A project based on the ESP8266 and WS2812b
MIT License
66 stars 28 forks source link

Switching between config pages allways turns on the Lamp #4

Closed StefaanVanDooren closed 4 years ago

StefaanVanDooren commented 4 years ago

Describe the bug When I open the Home webpage when the lamp is off, it stays off (GOOD) If I switch to one of the modepages (lamp still off), it turns the lamp on (BAD) and the button is still "Turn On" (GOOD).

This behavior also happens when switching between mode pages.

Expected behavior The lamp should stay off, until I press the "Turn ON" button

PS: I'm trying to understand how everything works, so if I find a solution I'll let you know. (I'm rather a noob when it come to the fastled library and the esp286 stuff

thebigpotatoe commented 4 years ago

This was actually a design feature. I decided that if you change the mode you most likely want the lights to come on. It also is a nice feedback mechanism to show that the light is working. The "turn on" button not updating to say "turn off" when the lights come on is a bug I noticed last night.

If you want, I can create a Boolean which simply disables this feature and allow users such as yourself to keep the lights off while changing mode.

StefaanVanDooren commented 4 years ago

A boolean would be nice. But it's your project, so you choose ;-)

thebigpotatoe commented 4 years ago

Added, just change the boolean on line 89 to false like;

bool autoOnWithModeChange = false;