Handle zone climate turnoff when mode is Heat or Cool only#360
Handle zone climate turnoff when mode is Heat or Cool only#360JDcongote wants to merge 1 commit intokamaradclimber:mainfrom
Conversation
kamaradclimber
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
I made a few small comments.
Also I'm concerned about this not playing nicely with the retry logic added in recent patches.
Have you been able to test this locally?
| async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: | ||
| if hvac_mode == HVACMode.HEAT: | ||
| # If operating mode is 0 (system is off), turn on main power first | ||
| if self._operating_mode == OperatingMode(0): |
There was a problem hiding this comment.
This block of code is repeated twice, I think we should factorize it outside of the conditional.
| 0, | ||
| False, | ||
| "utf-8", | ||
| ) |
There was a problem hiding this comment.
my experience is that heatpump needs a bit of time to accept commands after turning up. I suggest to add an async sleep instruction (2s should be sufficient)
| if new_operating_mode == OperatingMode(0): | ||
| # Turn off the entire system via main power switch | ||
| _LOGGER.debug( | ||
| f"{self._climate_type()} Turning off zone {self.zone_id} would leave no valid mode, turning off main power instead" |
There was a problem hiding this comment.
nitpick: I would suggest to phrase it in a way that does not suppose understanding of the underlying issue this PR is fixing.
What would you think of:
Removing last active mode for zone {zone_id}, turning off main power
?
No description provided.