mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-25 20:26:41 +00:00
Fix SHORT/LONG state when time is set to 0
This commit is contained in:
parent
b575405a1c
commit
cf0aab0f92
@ -115,12 +115,12 @@ bool IRAM_ATTR hasp_update_sleep_state()
|
||||
uint32_t idle = lv_disp_get_inactive_time(NULL);
|
||||
|
||||
if(idle >= (sleepTimeShort + sleepTimeLong) * 1000U) {
|
||||
if(hasp_sleep_state != HASP_SLEEP_LONG) {
|
||||
if(hasp_sleep_state != HASP_SLEEP_LONG && sleepTimeLong > 0) {
|
||||
dispatch_output_idle_state(HASP_SLEEP_LONG);
|
||||
hasp_sleep_state = HASP_SLEEP_LONG;
|
||||
}
|
||||
} else if(idle >= sleepTimeShort * 1000U) {
|
||||
if(hasp_sleep_state != HASP_SLEEP_SHORT) {
|
||||
if(hasp_sleep_state != HASP_SLEEP_SHORT && sleepTimeShort > 0) {
|
||||
dispatch_output_idle_state(HASP_SLEEP_SHORT);
|
||||
hasp_sleep_state = HASP_SLEEP_SHORT;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user