display climate implementation
This commit is contained in:
parent
ea2c2e076b
commit
19aae95252
4 changed files with 21 additions and 17 deletions
|
@ -92,6 +92,18 @@ void ClimateCard::saveStateToFRAM()
|
|||
void ClimateCard::loadStateFromFRAM()
|
||||
{
|
||||
fram->readObject(fram_address, this->state);
|
||||
// If temperature is out of range, set to its respective maximum or minimum
|
||||
if (state.ac_temperature > ac.max_temperature)
|
||||
state.ac_temperature = ac.max_temperature;
|
||||
else if (state.ac_temperature < ac.min_temperature)
|
||||
state.ac_temperature = ac.min_temperature;
|
||||
// If mode is out of range, set to 0
|
||||
if (state.ac_mode > ac.modes)
|
||||
state.ac_mode = 0;
|
||||
// If fan speed is out of range, set to 0
|
||||
if (state.ac_fan_speed > ac.fan_speeds)
|
||||
state.ac_fan_speed = 0;
|
||||
updateAirConditioner();
|
||||
}
|
||||
|
||||
void ClimateCard::setTemperature(uint8_t temperature)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue