update library; adjusted update behavior
This commit is contained in:
parent
c08a762c00
commit
ee4126f0a0
3 changed files with 11 additions and 2 deletions
|
|
@ -12,7 +12,7 @@
|
|||
platform = espressif32
|
||||
board = wt32-eth01
|
||||
framework = arduino
|
||||
lib_deps = siwats/ESPMegaPROR3@2.2.5
|
||||
lib_deps = siwats/ESPMegaPROR3@^2.3.3
|
||||
monitor_speed = 115200
|
||||
build_flags = -DCORE_DEBUG_LEVEL=5
|
||||
upload_port = COM28
|
||||
|
|
|
|||
|
|
@ -712,6 +712,14 @@ void ISEDisplay::updateAirPurifierStateStandby()
|
|||
|
||||
void ISEDisplay::updateAirPurifierState()
|
||||
{
|
||||
//check for page
|
||||
if(currentPage != 2){
|
||||
return;
|
||||
}
|
||||
else if(currentPage ==1){
|
||||
updateAirPurifierStateStandby();
|
||||
return;
|
||||
}
|
||||
// Get the state
|
||||
bool state = strcmp(pm_switch->getValue(), "on") == 0;
|
||||
ESP_LOGI("ISEDisplay", "Updating air purifier state to: %d", state);
|
||||
|
|
|
|||
|
|
@ -190,9 +190,10 @@ void loop()
|
|||
}
|
||||
// Update the PM state every 1 seconds
|
||||
static uint32_t last_pm_switch_update = 0;
|
||||
if (millis() - last_pm_switch_update > 5000)
|
||||
if (millis() - last_pm_switch_update > 500)
|
||||
{
|
||||
iseDisplay.updateAirPurifierState();
|
||||
last_pm_switch_update = millis();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue