Merge branch 'all-toggle-fix'

This commit is contained in:
reaw55 2024-06-22 06:19:04 +07:00
commit f249dfe314

View file

@ -1152,24 +1152,44 @@ bool ISEDisplay::calculateAllState()
}
void ISEDisplay::toggleSystem()
{
toggleLightGroupState();
// check for ac lock and pm lock, if lock is on do nothing
if (this->ac_lock_state == true)
// toggleLightGroupState();
// // check for ac lock and pm lock, if lock is on do nothing
// if (this->ac_lock_state == true)
// {
// ESP_LOGI("ISEDisplay", "AC lock is on, do nothing");
// }
// else
// {
// toggleAC();
// }
// if (this->pm_lock_state == true)
// {
// ESP_LOGI("ISEDisplay", "PM lock is on, do nothing");
// }
// else
// {
// togglePM();
// }
bool state = calculateAllState();
if (state)
{
ESP_LOGI("ISEDisplay", "AC lock is on, do nothing");
setACstate(0, ac_fan_speed, ac_temperature);
setLightGroupState(0);
setPMstate(false, pm_fan_speed);
}
else
{
toggleAC();
}
if (this->pm_lock_state == true)
{
ESP_LOGI("ISEDisplay", "PM lock is on, do nothing");
}
else
{
togglePM();
setACstate(2, ac_fan_speed, ac_temperature);
setLightGroupState(3);
setPMstate(true, pm_fan_speed);
}
}
void ISEDisplay::allToggleStandby()
{