diff --git a/Template Project/lib/ESPMegaPRO/ClimateCard.cpp b/Template Project/lib/ESPMegaPRO/ClimateCard.cpp index 9e2cada..1c816d9 100644 --- a/Template Project/lib/ESPMegaPRO/ClimateCard.cpp +++ b/Template Project/lib/ESPMegaPRO/ClimateCard.cpp @@ -86,18 +86,24 @@ void ClimateCard::setTemperature(uint8_t temperature) { this->state.ac_temperature = temperature; updateAirConditioner(); + if (fram_auto_save) + saveStateToFRAM(); } void ClimateCard::setMode(uint8_t mode) { this->state.ac_mode = mode; updateAirConditioner(); + if (fram_auto_save) + saveStateToFRAM(); } void ClimateCard::setFanSpeed(uint8_t fan_speed) { this->state.ac_fan_speed = fan_speed; updateAirConditioner(); + if (fram_auto_save) + saveStateToFRAM(); } void ClimateCard::registerCallback(std::function callback) @@ -146,6 +152,7 @@ void ClimateCard::updateAirConditioner() { callbacks[i](this->state.ac_temperature, this->state.ac_mode, this->state.ac_fan_speed); } + } float ClimateCard::getRoomTemperature()