update preset based on toggledOnOff bool
This commit is contained in:
parent
0b857cba8d
commit
c2fe15a6cf
@ -63,6 +63,8 @@ void toggleOnOff()
|
||||
briLast = bri;
|
||||
bri = 0;
|
||||
}
|
||||
stateChanged = true;
|
||||
toggledOnOff = true;
|
||||
}
|
||||
|
||||
|
||||
@ -100,7 +102,7 @@ void stateUpdated(byte callMode) {
|
||||
setValuesFromFirstSelectedSeg();
|
||||
|
||||
if (bri != briOld || stateChanged) {
|
||||
if (stateChanged) currentPreset = 0; //something changed, so we are no longer in the preset
|
||||
if (stateChanged && !toggledOnOff) currentPreset = 0; //something changed, so we are no longer in the preset, except for turning the LEDs on/off
|
||||
|
||||
if (callMode != CALL_MODE_NOTIFICATION && callMode != CALL_MODE_NO_NOTIFY) notify(callMode);
|
||||
if (bri != briOld && nodeBroadcastEnabled) sendSysInfoUDP(); // update on state
|
||||
@ -108,6 +110,7 @@ void stateUpdated(byte callMode) {
|
||||
//set flag to update ws and mqtt
|
||||
interfaceUpdateCallMode = callMode;
|
||||
stateChanged = false;
|
||||
toggledOnOff = false;
|
||||
} else {
|
||||
if (nightlightActive && !nightlightActiveOld && callMode != CALL_MODE_NOTIFICATION && callMode != CALL_MODE_NO_NOTIFY) {
|
||||
notify(CALL_MODE_NIGHTLIGHT);
|
||||
|
Loading…
Reference in New Issue
Block a user