geerlingguy / beast-challenge

A control system for MrBeast's 1-100 challenge
GNU General Public License v3.0
26 stars 1 forks source link

Add Button LED Light tracking for rooms #10

Closed geerlingguy closed 1 year ago

geerlingguy commented 1 year ago

Each of the buttons should have a row in the rooms table, like led_1, led_2, led_3, with an INTEGER and default to 0 for off.

When a round begins, the LEDs could be lit by the code updating the row for each room and setting the LEDs appropriately in the rooms table.

When a round becomes "active", then maybe we look at how many values there are for that round, and light up the LEDs corresponding to the values that are entered / not NULL.

And maybe we set it so the LEDs are lit while voting is allowed, and for rounds where you only get one vote, the LEDs turn off once you've voted? Or it turns off all the LEDs on the buttons which you didn't press.

We'd probably want some sort of cron job or state machine running that would clean up any missed LED interactions every minute or 5 minutes or something... I can see the button LED state getting out of whack in a crunchy scenario with lots of voting activity, especially if it's like "whoever hits a button the soonest after I open this round of voting!"

There are three steps to this issue:

geerlingguy commented 1 year ago

See #34 — hopefully we can nix it and go with that instead.