geoffdavis / esphome-mitsubishiheatpump

ESPHome Climate Component for Mitsubishi Heatpumps using direct serial connection
BSD 2-Clause "Simplified" License
560 stars 153 forks source link

Store setpoints per-mode to make selection work like the IR remote. #10

Closed pgenera closed 4 years ago

pgenera commented 4 years ago

Persist per-mode temperature setpoints (in either RTC ram or flash depending on configuration), and use them when mode changes are commanded. This means a mode change works like the IR remote, change to the most recently used temperature for that mode. If you instead call climate.set_temperature with both a new temperature and a new mode, the temperature in the service call is used instead.

The silliness in load() and save() is due to the ESP8266 (at least) not having enough available RTC ram to store 3 floats.