zacs / ha-dualmodegeneric

Generic thermostat capable of heating and cooling
68 stars 26 forks source link

Support flags not setting correctly #29

Closed Shadewing666 closed 3 years ago

Shadewing666 commented 3 years ago

Hi Zacs,

Looks like the latest update, 13b047b, breaks the Heat/Cool feature, or it does for me at least.

I think I tracked the problem to the inclusion of this line from the latest update: self._support_flags = SUPPORT_FLAGS

I noticed that my climate entity had a supported_features value of 1, which corresponds with SUPPORT_TARGET_TEMPERATURE. It would need a value of 2 at least to have SUPPORT_TARGET_TEMPERATURE_RANGE enabled. HA Dev Docs page

I rolled back the update as having the climate controls in the bedroom not working is not an option but I can run tests if you need and just restore a snapshot after.

david-kalbermatten commented 3 years ago

Yea, somebody probably didn't merge properly when adding the unique_id feature in #26.

The last line shouldn't be there. It overwrites the check-based assignment that comes before it...

if self._enable_heat_cool:
    self._support_flags = SUPPORT_FLAGS | SUPPORT_TARGET_TEMPERATURE_RANGE
else:
    self._support_flags = SUPPORT_FLAGS

[...]

self._support_flags = SUPPORT_FLAGS
david-kalbermatten commented 3 years ago

Now it's up to you @zacs ;D

zacs commented 3 years ago

Thanks for the PR. Weird that no merge conflict got found in #26. In any case, merging now.