-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fan modes #154
base: master
Are you sure you want to change the base?
Fix fan modes #154
Conversation
Replace self.fan_mode by self._attr_fan_mode, because the latter is used everywhere else.
self._attr_fan_modes already contains values rewritten to FAN_HIGH and HVAC_FAN_MAX. `if fan_mode not in self._attr_fan_modes`, it's impossible to fail the `fan_mode != FAN_HIGH and fan_mode != HVAC_FAN_MAX` check. Also fix a typo: "swing mode" -> "fan mode".
HVAC_FAN_MAX_HIGH and HVAC_FAN_AUTO_MAX are filtered out from self._attr_fan_modes in __init__(). All the further checks for HVAC_FAN_MAX_HIGH and HVAC_FAN_AUTO_MAX will always fail, making the ELECTRA_AC workaround a no-op. Fix it by storing the workaround status in self._quirk_fan_max_high. Fixes: de5a190 ("Aggressive use of _attr_* properties, cleanup and normalization")
Home Assistant has standard high/low fan modes that are localized and displayed in the UI in a pretty way. Tasmota IRHVAC has min, low, middle, high and max, along with a few other modes. Min and max are displayed in Home Assistant as is and not localized. While nothing can be done on the integration side for air conditioners that use 5 levels of the fan, some air conditioners have 3 levels, but use min/medium/max instead of low/medium/high. For such ACs, convert min->low and max->high to display pretty localized values in the UI.
87a8859
to
9e3ad34
Compare
Hey @gentoo-root This is a pretty nice PR as I did notice my min and max options are not localized. We're investigating some issues with ARGO decoding in here. I was wondering if you could also add handling for a mid-high state that Tasmota reports for my ARGO AC as no existing This unit's fan speeds are auto, min, med-high, high. If not, I'll create a PR after this one merges so that I can adapt handling of med-high so it shows correctly in the UI along with low and max which you corrected. |
The proposed changes are breaking another tweak for ELECTRA_AC, listed below, which is tested on a real device. This is why you think there is a redundant checks in the code. It is not redundant, it is for limiting the fix only for those devices, that needs it. Please, rewrite your PR code, without breaking the existing fix. supported_modes:
# Some devices have "auto" and "fan_only" switched
# If the following two lines are uncommented, "auto" and "fan" shoud be commented out
#- "auto_fan_only" #if remote shows fan but tasmota says auto
#- "fan_only_auto" #if remote shows auto but tasmota says fan
supported_fan_speeds:
# Some devices say max,but it is high, and auto which is max
# If you uncomment the following two, you have to comment high and max
# - "auto_max" #woud become max
# - "max_high" #would become high |
If it's tested and works on a real device, I'm curious to know how. One of my commits is actually supposed to fix ELECTRA_AC after a breaking change made in commit de5a190. As I explained in the commit message, the relevant ELECTRA_AC code flows became unreachable after de5a190, because HVAC_FAN_MAX_HIGH and HVAC_FAN_AUTO_MAX can't be in Assuming my understanding is correct, the code I removed in 8e4a1b7 can be removed safely:
|
Fix the ELECTRA_AC workaround that became a no-op in de5a190 (not tested with the real hardware).
Prettify the way how fan modes are displayed in the UI for ACs that use min/medium/max instead of low/medium/high.