Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify CMD_DIMM_LEDS_NIGHTMODE to toggle night light mode #287

Merged
merged 5 commits into from
Jan 14, 2024

Conversation

laszloh
Copy link
Contributor

@laszloh laszloh commented Jan 11, 2024

This PR modifies the LED brightness handling and cleans up the sleep mode actions.
for discussion see: https://forum.espuino.de/t/nachtmodus-gedimmte-leds-beenden/2656/2

Led brightness handling

  • Led_SetNightmode(bool enabled) Enable and disable night light mode; if we are disabling the night mode, the previous brightness is restored
  • bool Led_GetNightmode() Return current status of the night mode
  • void Led_ToggleNightmode() Toggles the night mode on and off

MQTT brightness message handling

The handling of the "topicLedBrightnessState" MQTT-message is moved into the LEDs module

Unify the sleep Handling

Unify the handling of the sleep modi. This removes 2 log messages in favour of a unified sleep action handling.

Add dedictated function to switch between nicht-mode and normal brightness of the WS2812 LEDs.
Move to the use of these functions.
Add new log message to inform when the LED brightness was restored.
Only time to send dedicated LED brightness messages from other modules is on reconnect.
@biologist79 biologist79 merged commit 39ad764 into biologist79:dev Jan 14, 2024
10 checks passed
@biologist79
Copy link
Owner

Merged!
Thanks for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants