hOn/custom_components/hon
danyrd92 5cf7f812f4
Fix AC reverting to AUTO mode when changing settings after Home Assistant restart (#21)
After restarting Home Assistant, the AC entity correctly restores its previous state (e.g. HEAT mode at a given temperature).
However, changing any setting (temperature, fan speed, or swing mode) caused the device to switch back to AUTO mode.

Root cause

The settings command was being sent with partially initialized parameters after a restart.
When only a single value (e.g. temperature) was updated, other parameters such as machMode and onOffStatus were implicitly sent with their default values, which for many devices means AUTO mode.

Solution

Before sending the settings command, the current machMode and onOffStatus are now explicitly copied from the device state into the command parameters.
This ensures that changing temperature, fan mode, or swing mode does not unintentionally reset the HVAC mode.

Result

The AC keeps the selected HVAC mode (HEAT/COOL/etc.) after a Home Assistant restart.

Updating temperature, fan speed, or swing no longer forces the device back to AUTO.

No change in behavior when explicitly changing HVAC mode or presets.
2025-12-18 18:26:39 +01:00
..
translations Update translations 2024-03-17 21:52:54 +01:00
__init__.py Fix incompatibility with HA 2025.6 2025-06-26 01:00:29 +02:00
binary_sensor.py Add defrost status binary sensor for AC appliances (#15) 2025-12-16 17:37:55 +01:00
button.py Fix HomeAssistantType deprecation warning 2025-06-26 00:59:54 +02:00
climate.py Fix AC reverting to AUTO mode when changing settings after Home Assistant restart (#21) 2025-12-18 18:26:39 +01:00
config_flow.py Fix mypy errors 2023-11-20 16:39:33 +01:00
const.py Change poll to push 2024-03-25 02:26:20 +01:00
entity.py Fix automatic updates of entities 2025-06-26 01:02:47 +02:00
fan.py Fix automatic updates of entities 2025-06-26 01:02:47 +02:00
light.py Fix automatic updates of entities 2025-06-26 01:02:47 +02:00
lock.py Fix automatic updates of entities 2025-06-26 01:02:47 +02:00
manifest.json Bump version v0.16.1 2025-11-10 00:57:04 +01:00
number.py Fix automatic updates of entities 2025-06-26 01:02:47 +02:00
select.py Fix automatic updates of entities 2025-06-26 01:02:47 +02:00
sensor.py Remove 3 of 4 added earlier sensors as they don't show anything 2025-10-24 19:12:57 +02:00
switch.py Fix automatic updates of entities 2025-06-26 01:02:47 +02:00
typedefs.py Fix issues from refactoring 2023-07-24 21:37:48 +02:00
util.py Rebuild to single data coordinator 2024-03-29 01:22:44 +01:00