From c56a98f8239532a6b0c8c689f0d8e63e074526ef Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Sat, 23 Mar 2024 01:54:52 +0700 Subject: [PATCH] fix ac load state bug --- ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ClimateCard.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ClimateCard.cpp b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ClimateCard.cpp index ce4f9c5..0089968 100644 --- a/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ClimateCard.cpp +++ b/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/ClimateCard.cpp @@ -152,6 +152,10 @@ void ClimateCard::loadStateFromFRAM() { if (fram == nullptr) return; + // Retrieve state from FRAM + state.ac_temperature = fram->read8(fram_address); + state.ac_mode = fram->read8(fram_address + 1); + state.ac_fan_speed = fram->read8(fram_address + 2); if (state.ac_temperature > ac.max_temperature) state.ac_temperature = ac.max_temperature; else if (state.ac_temperature < ac.min_temperature)