fram saving feature
This commit is contained in:
parent
1ee4209e3c
commit
b1dd128aa1
|
@ -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<void(uint8_t, uint8_t, uint8_t)> 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()
|
||||
|
|
Loading…
Reference in New Issue