fix ac load state bug

This commit is contained in:
Siwat Sirichai 2024-03-23 01:54:52 +07:00
parent 62aa76b06a
commit c56a98f823
1 changed files with 4 additions and 0 deletions

View File

@ -152,6 +152,10 @@ void ClimateCard::loadStateFromFRAM()
{ {
if (fram == nullptr) if (fram == nullptr)
return; 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) if (state.ac_temperature > ac.max_temperature)
state.ac_temperature = ac.max_temperature; state.ac_temperature = ac.max_temperature;
else if (state.ac_temperature < ac.min_temperature) else if (state.ac_temperature < ac.min_temperature)