|
@ -74,7 +74,9 @@ bool System_SetSleepTimer(uint8_t minutes) { |
|
|
System_SleepTimerStartTimestamp = 0u; |
|
|
System_SleepTimerStartTimestamp = 0u; |
|
|
Led_ResetToInitialBrightness(); |
|
|
Led_ResetToInitialBrightness(); |
|
|
Log_Println((char *) FPSTR(modificatorSleepd), LOGLEVEL_NOTICE); |
|
|
Log_Println((char *) FPSTR(modificatorSleepd), LOGLEVEL_NOTICE); |
|
|
|
|
|
#ifdef MQTT_ENABLE
|
|
|
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false); |
|
|
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false); |
|
|
|
|
|
#endif
|
|
|
} else { |
|
|
} else { |
|
|
System_SleepTimer = minutes; |
|
|
System_SleepTimer = minutes; |
|
|
System_SleepTimerStartTimestamp = millis(); |
|
|
System_SleepTimerStartTimestamp = millis(); |
|
@ -82,8 +84,10 @@ bool System_SetSleepTimer(uint8_t minutes) { |
|
|
|
|
|
|
|
|
Led_ResetToNightBrightness(); |
|
|
Led_ResetToNightBrightness(); |
|
|
Log_Println((char *) FPSTR(modificatorSleepTimer60), LOGLEVEL_NOTICE); |
|
|
Log_Println((char *) FPSTR(modificatorSleepTimer60), LOGLEVEL_NOTICE); |
|
|
|
|
|
#ifdef MQTT_ENABLE
|
|
|
publishMqtt((char *) FPSTR(topicSleepTimerState), System_SleepTimer, false); |
|
|
publishMqtt((char *) FPSTR(topicSleepTimerState), System_SleepTimer, false); |
|
|
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false); |
|
|
publishMqtt((char *) FPSTR(topicLedBrightnessState), Led_GetBrightness(), false); |
|
|
|
|
|
#endif
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return sleepTimerEnabled; |
|
|
return sleepTimerEnabled; |
|
@ -118,11 +122,15 @@ void System_ToggleLockControls(void) { |
|
|
|
|
|
|
|
|
if (System_LockControls) { |
|
|
if (System_LockControls) { |
|
|
Log_Println((char *) FPSTR(modificatorAllButtonsLocked), LOGLEVEL_NOTICE); |
|
|
Log_Println((char *) FPSTR(modificatorAllButtonsLocked), LOGLEVEL_NOTICE); |
|
|
|
|
|
#ifdef MQTT_ENABLE
|
|
|
publishMqtt((char *) FPSTR(topicLockControlsState), "ON", false); |
|
|
publishMqtt((char *) FPSTR(topicLockControlsState), "ON", false); |
|
|
|
|
|
#endif
|
|
|
System_IndicateOk(); |
|
|
System_IndicateOk(); |
|
|
} else { |
|
|
} else { |
|
|
Log_Println((char *) FPSTR(modificatorAllButtonsUnlocked), LOGLEVEL_NOTICE); |
|
|
Log_Println((char *) FPSTR(modificatorAllButtonsUnlocked), LOGLEVEL_NOTICE); |
|
|
|
|
|
#ifdef MQTT_ENABLE
|
|
|
publishMqtt((char *) FPSTR(topicLockControlsState), "OFF", false); |
|
|
publishMqtt((char *) FPSTR(topicLockControlsState), "OFF", false); |
|
|
|
|
|
#endif
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|