Skip to content

Commit

Permalink
enabling light will also broadcast dimmer value (as reequested by use…
Browse files Browse the repository at this point in the history
…r...)
  • Loading branch information
openshwprojects committed Nov 29, 2022
1 parent 5e18eaa commit 5b89deb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/cmnds/cmd_newLEDDriver.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,25 @@ void LED_ToggleEnabled() {
LED_SetEnableAll(!g_lightEnableAll);
}
void LED_SetEnableAll(int bEnable) {
bool bEnableAllWasSetTo1;

if (g_lightEnableAll == 0 && bEnable == 1) {
bEnableAllWasSetTo1 = true;
}
else {
bEnableAllWasSetTo1 = false;
}
g_lightEnableAll = bEnable;

apply_smart_light();
#ifndef OBK_DISABLE_ALL_DRIVERS
DRV_DGR_OnLedEnableAllChange(bEnable);
#endif
LED_SendEnableAllState();

// if enable all was set to 1 this frame, also send dimmer
// https://github.com/openshwprojects/OpenBK7231T_App/issues/498
// TODO: check if it's OK
LED_SendDimmerChange();
}
int LED_GetEnableAll() {
return g_lightEnableAll;
Expand Down

0 comments on commit 5b89deb

Please sign in to comment.