Skip to content
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

Bugfix - Support devices only having mode heat_cool instead of heat (#1322) #1533

Merged

Conversation

folfy
Copy link
Collaborator

@folfy folfy commented Dec 21, 2024

Motivation:

Fix #1322 - Support devices only having mode heat_cool, but not heat

Changes:

  • Cleaned up some overly nested if's while scrolling through the code
  • Remap HEAT -> HEAT_COOL (outbound) and HEAT_COOL -> HEAT (inbound), like the swap-auto feature
    (this seemed to be easiest and fastest solution for now)

Related issue (check one):

Checklist (check one):

  • I did not change any code (e.g. documentation changes)
  • The code change is tested and works locally.

Test-Hardware list (for code changes)

HA Version: 2024.12.1
Zigbee2MQTT Version:
TRV Hardware:

@folfy
Copy link
Collaborator Author

folfy commented Dec 21, 2024

Not tested yet, based this now on the v1.7.0b1 branch (still dunno which version to work on rly)

Update: To be tested by @Sir-Udo (testing fix in helpers.py with HEAT_COOL-only TRV)

@Sir-Udo
Copy link

Sir-Udo commented Dec 23, 2024

Hi,
test = passed.
All thermostats are directly online also after I reboot HomeAssistant several times.
Many THX and greetings
Udo

trv_modes = self.real_trvs[entity_id]["hvac_modes"]
if not HVACMode.HEAT in trv_modes and HVACMode.HEAT_COOL in trv_modes:
# entity only supports HEAT_COOL, but not HEAT - need to translate
if not inbound and hvac_mode = HVACMode.HEAT:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be equal == instead of =
?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh definitely, thanks - been jumping between projects with different languages too much apparently 😅

Copy link
Collaborator Author

@folfy folfy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be fixed

trv_modes = self.real_trvs[entity_id]["hvac_modes"]
if not HVACMode.HEAT in trv_modes and HVACMode.HEAT_COOL in trv_modes:
# entity only supports HEAT_COOL, but not HEAT - need to translate
if not inbound and hvac_mode = HVACMode.HEAT:
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh definitely, thanks - been jumping between projects with different languages too much apparently 😅

@KartoffelToby
Copy link
Owner

@folfy There was a typo error on the if statement, and the linting was not correct, i'll fix it, thank you so much for your work!

@KartoffelToby KartoffelToby merged commit 57c852b into KartoffelToby:feature/ha_compatibility Jan 3, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants