add toogle; adjust code behavior

This commit is contained in:
reaw55 2024-04-20 14:25:12 +07:00
parent d4604d28c3
commit 88931f3001
17 changed files with 358 additions and 96 deletions

View file

@ -70,6 +70,9 @@ AirConditioner ac_york = {
ESPMegaPRO espmega = ESPMegaPRO();
ISEDisplay iseDisplay = ISEDisplay(&iseDisplayAdapter, &light_array[0][0], row, column);
ESPMegaDisplayOTA iseDisplayOTA = ESPMegaDisplayOTA();
ESPMegaDisplayOTA internalDisplayOTA = ESPMegaDisplayOTA();
ClimateCard climateCard_daikin = ClimateCard(AIR_CONDITIONER_DAIKIN_IR_PIN, ac_daikin,
AIR_CONDITIONER_SENSOR_TYPE, AIR_CONDITIONER_SENSOR_PIN,
AIR_CONDITIONER_RMT_CHANNEL0);
@ -293,6 +296,8 @@ void setup()
auto bindedGetTime = std::bind(&ESPMegaPRO::getTime, &espmega);
iseDisplay.begin(&espmega.inputs, &espmega.outputs, &climateCard_daikin, &climateCard_york, &pm_switch, &pm_fan_speed, &pm_lock, &ac_lock, espmega.iot);
espmega.iot->registerRelativeMqttCallback(&handleMqttMessage);
iseDisplayOTA.begin("/isedisp", &iseDisplay, espmega.webServer);
internalDisplayOTA.begin("/intdisp", espmega.display, espmega.webServer);
iseDisplay.registerPageChangeCallback(&handlePageChange);
// ------------ End External Display Initialization Routine ------------
}
@ -321,6 +326,7 @@ void pmswitchupdatedisplay(char *value)
{
ESP_LOGI("PM switch", "getting PM switch state from MQTT: %d", pm_switch.getValue());
iseDisplay.updateAirPurifierState();
iseDisplay.updateSystemtoggle();
ESP_LOGI("PM switch", "toggling PM switch state from: %d to %d", pm_switch.getValue(), !pm_switch.getValue());
}
void pmlockupdatedisplay(char *value)