hOn/custom_components
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
..
hon Fix AC reverting to AUTO mode when changing settings after Home Assistant restart (#21) 2025-12-18 18:26:39 +01:00