Bump zhong-hong-hvac to 1.0.15 and add gateway health availability to zhong_hong - #177945
Bump zhong-hong-hvac to 1.0.15 and add gateway health availability to zhong_hong#177945crhan wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates ZhongHong climate entities to use gateway health reporting and periodic polling.
Changes:
- Bumps
zhong-hong-hvacto 1.0.14. - Adds 60-second polling and connection-based availability.
- Adds command-failure logging and fan-mode validation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
homeassistant/components/zhong_hong/manifest.json |
Updates the library dependency. |
homeassistant/components/zhong_hong/climate.py |
Adds polling, availability, and command handling. |
Suppressed comments (4)
homeassistant/components/zhong_hong/climate.py:251
- Return the gateway send result from the library before checking
turn_off(). The v1.0.14HVAC.send()implementation returnsNone, making this warning unconditional after every turn-off command.
if not self._device.turn_off():
_LOGGER.warning("%s: failed to send turn-off command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:260
- Fix the library's command return propagation before checking
set_temperature(). Version 1.0.14'sHVAC.send()drops the boolean result, so this logs a failure for successful temperature commands too.
if not self._device.set_temperature(temperature):
_LOGGER.warning(
"%s: failed to send temperature command", self.entity_id
)
homeassistant/components/zhong_hong/climate.py:277
- Fix the library's command return propagation before checking
set_operation_mode(). Because v1.0.14'sHVAC.send()returnsNone, every mode command reaches this warning regardless of whether it was sent successfully.
if not self._device.set_operation_mode(hvac_mode.upper()):
_LOGGER.warning("%s: failed to send mode command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:287
- Fix the library's command return propagation before checking
set_fan_mode(). The v1.0.14HVAC.send()method discardsgateway.send()'s bool, so this warns after successful fan commands as well.
if not self._device.set_fan_mode(mapped_mode):
_LOGGER.warning("%s: failed to send fan command", self.entity_id)
| if not self._device.turn_on(): | ||
| _LOGGER.warning("%s: failed to send turn-on command", self.entity_id) |
| "loggers": ["zhong_hong_hvac"], | ||
| "quality_scale": "legacy", | ||
| "requirements": ["zhong-hong-hvac==1.0.13"] | ||
| "requirements": ["zhong-hong-hvac==1.0.14"] |
| "loggers": ["zhong_hong_hvac"], | ||
| "quality_scale": "legacy", | ||
| "requirements": ["zhong-hong-hvac==1.0.13"] | ||
| "requirements": ["zhong-hong-hvac==1.0.14"] |
c2bcc01 to
46889e6
Compare
|
Thanks for the review. The Copilot comments are correct: in zhong-hong-hvac 1.0.14 |
46889e6 to
f994aac
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
homeassistant/components/zhong_hong/climate.py:244
- Restore the repository's complete PR template and correct its dependency details before merge. The current description omits the required Type of change, Additional information, and Checklist sections, and repeatedly says 1.0.14 even though the code pins 1.0.15; the control-method return propagation used here was also added only in 1.0.15.
if not self._device.turn_on():
_LOGGER.warning("%s: failed to send turn-on command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:44
- Split these functional integration changes into a separate PR and keep this dependency-upgrade PR limited to the manifest and generated requirement updates. The polling, availability, validation, and command-logging behavior is not required merely to bump the package version and must be reviewed independently.
SCAN_INTERVAL = timedelta(seconds=60)
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (6)
homeassistant/components/zhong_hong/climate.py:250
- Raise
HomeAssistantErrorwhen the turn-off send fails. Logging and returning makes the climate service report success even though the library exhausted its send retries, so callers cannot detect the failed action.
if not self._device.turn_off():
_LOGGER.warning("%s: failed to send turn-off command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:244
- Raise
HomeAssistantErrorwhen the turn-on send fails. Logging and returning makes the climate service report success even though the library exhausted its send retries, so callers cannot detect the failed action.
if not self._device.turn_on():
_LOGGER.warning("%s: failed to send turn-on command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:259
- Raise
HomeAssistantErrorwhen the temperature send fails. Logging and continuing makes the service report success—and may proceed to change the HVAC mode—even though the requested temperature was not sent.
if not self._device.set_temperature(temperature):
_LOGGER.warning(
"%s: failed to send temperature command", self.entity_id
)
homeassistant/components/zhong_hong/climate.py:276
- Raise
HomeAssistantErrorwhen the operation-mode send fails. Logging and returning makes the climate service report success after the library has reported that the command could not be sent.
if not self._device.set_operation_mode(hvac_mode.upper()):
_LOGGER.warning("%s: failed to send mode command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:286
- Raise
HomeAssistantErrorwhen the fan-mode send fails. Logging and returning makes the climate service report success after the library has reported that the command could not be sent.
if not self._device.set_fan_mode(mapped_mode):
_LOGGER.warning("%s: failed to send fan command", self.entity_id)
homeassistant/components/zhong_hong/manifest.json:9
- Update and complete the PR description before merge. The code pins 1.0.15, but the Summary and Testing sections still claim 1.0.14—even though 1.0.15 contains the send-result fix these new checks depend on—and the required Home Assistant PR-template sections and checklists are missing.
"requirements": ["zhong-hong-hvac==1.0.15"]
f994aac to
f04356f
Compare
f04356f to
7a4d1a8
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
homeassistant/components/zhong_hong/manifest.json:9
- Restore the full PR template and make its version references consistent with 1.0.15. The current description omits the required Proposed change, Type of change, Additional information, and Checklist sections, and still states that this pins/publishes 1.0.14 while the changed requirement is 1.0.15.
"requirements": ["zhong-hong-hvac==1.0.15"]
homeassistant/components/zhong_hong/climate.py:188
- Move the runtime behavior changes into a follow-up PR. This dependency upgrade also changes polling, availability, and command handling, so separating those changes keeps the package update independently reviewable and revertible.
def update(self) -> None:
|
The only failing CI check ( |
… zhong_hong The gateway connection in zhong-hong-hvac 1.0.13 can die silently: a status frame with an undefined fan speed value (0x00) crashes the listener thread and nothing restarts it, so entities keep showing stale state forever with no health signal. zhong-hong-hvac 1.0.15 fixes the library (tolerant parsing, listener self-healing, health probes, reconnect), propagates send results through the HVAC control methods, and exposes ZhongHongGateway.connected / HVAC.connected. This PR: - pins zhong-hong-hvac to 1.0.15 - polls every entity every 60 s so state self-heals even when the gateway stops pushing - marks entities unavailable when the gateway connection is unhealthy - logs a warning when a control command cannot be sent - stops sending an invalid fan mode to the library when an unsupported value is requested Signed-off-by: ruohan.chen <crhan123@gmail.com>
7a4d1a8 to
35a922e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (8)
homeassistant/components/zhong_hong/climate.py:244
- Raise
HomeAssistantErrorwhen the turn-on send fails. Logging and returning normally makes the climate service call report success even though the library returnedFalse, so callers and automations cannot detect the failure.
if not self._device.turn_on():
_LOGGER.warning("%s: failed to send turn-on command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:250
- Raise
HomeAssistantErrorwhen the turn-off send fails. A warning followed by a normal return reports this failed command as a successful climate service call.
if not self._device.turn_off():
_LOGGER.warning("%s: failed to send turn-off command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:259
- Raise
HomeAssistantErrorwhen sending the temperature fails. Returning normally after the library reportsFalseprevents the service caller from detecting that the target temperature was not sent.
if not self._device.set_temperature(temperature):
_LOGGER.warning(
"%s: failed to send temperature command", self.entity_id
)
homeassistant/components/zhong_hong/climate.py:276
- Raise
HomeAssistantErrorwhen sending the HVAC mode fails. Logging alone causes the service call to complete successfully despite the mode command not being sent.
if not self._device.set_operation_mode(hvac_mode.upper()):
_LOGGER.warning("%s: failed to send mode command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:286
- Raise
HomeAssistantErrorwhen sending the fan mode fails. This warning-only path reports success to the service caller even though the library explicitly returnedFalse.
if not self._device.set_fan_mode(mapped_mode):
_LOGGER.warning("%s: failed to send fan command", self.entity_id)
homeassistant/components/zhong_hong/manifest.json:9
- Restore the complete PR template in the description. The current Summary/Testing-only description omits the required Proposed change, Type of change, Additional information, Checklist, conditional dependency checklist, and review checklist sections and checkboxes.
"requirements": ["zhong-hong-hvac==1.0.15"]
homeassistant/components/zhong_hong/manifest.json:9
- Update the PR description to consistently identify version 1.0.15. It says both the pin and published/tested SDK are 1.0.14, but this manifest and
requirements_all.txtinstall 1.0.15; the latter is material because only 1.0.15 propagates command send results.
"requirements": ["zhong-hong-hvac==1.0.15"]
homeassistant/components/zhong_hong/manifest.json:9
- Split the integration behavior changes into a separate PR. Dependency bump PRs must contain only files required for the version bump; keep the manifest and generated requirement update here and move the
climate.pychanges.
"requirements": ["zhong-hong-hvac==1.0.15"]
|
Rebased onto current The only remaining red mark is the |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (8)
homeassistant/components/zhong_hong/climate.py:244
- Raise
HomeAssistantErrorwhen the turn-on send fails instead of returning normally. Logging alone makes the climate action report success to the caller even though the library returnedFalse; use a translatable action exception.
if not self._device.turn_on():
_LOGGER.warning("%s: failed to send turn-on command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:197
- Fix the upstream no-first-response health state before relying on
connectedhere. Inzhong-hong-hvac1.0.15,connectedreturnsTruewhile_last_seen is None, and_maybe_probe()also returns without probing in that state, so a gateway that goes silent after discovery but before the listener receives its first frame remains available indefinitely with stale or empty state; update the library to time out/probe this state and bump to that release.
return self._hub.connected
homeassistant/components/zhong_hong/climate.py:250
- Raise
HomeAssistantErrorwhen the turn-off send fails instead of returning normally. Logging alone makes the climate action report success to the caller even though the command was not sent; use a translatable action exception.
if not self._device.turn_off():
_LOGGER.warning("%s: failed to send turn-off command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:259
- Raise
HomeAssistantErrorwhen the temperature send fails instead of returning normally. Otherwise the action reports success and may continue to change the HVAC mode after the requested temperature was not sent; use a translatable action exception.
if not self._device.set_temperature(temperature):
_LOGGER.warning(
"%s: failed to send temperature command", self.entity_id
)
homeassistant/components/zhong_hong/climate.py:276
- Raise
HomeAssistantErrorwhen the operation-mode send fails instead of returning normally. Logging alone makes the climate action report success despite the failed command; use a translatable action exception.
if not self._device.set_operation_mode(hvac_mode.upper()):
_LOGGER.warning("%s: failed to send mode command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:286
- Raise
HomeAssistantErrorwhen the fan-mode send fails instead of returning normally. Logging alone makes the climate action report success despite the failed command; use a translatable action exception.
if not self._device.set_fan_mode(mapped_mode):
_LOGGER.warning("%s: failed to send fan command", self.entity_id)
homeassistant/components/zhong_hong/climate.py:145
- Split the behavioral changes into a separate PR and keep this dependency-upgrade PR limited to the version/generated requirement updates. Repository review policy requires dependency bumps not to include unrelated feature changes such as enabling polling and availability handling.
_attr_should_poll = True
homeassistant/components/zhong_hong/manifest.json:9
- Restore the complete repository PR template before review. The description replaces
Proposed changewithSummary, omitsAdditional informationand the full checklist, and checks two change types even though the template requires exactly one.
"requirements": ["zhong-hong-hvac==1.0.15"]
|
Status update — all checks green except the two below:
Thanks for the review! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
Suppressed comments (2)
homeassistant/components/zhong_hong/climate.py:145
- Split the behavioral changes into a separate bug-fix PR. Dependency-upgrade PRs may contain only changes required for the version bump, while enabling polling and adding availability/command handling are independent consumer behavior changes that should be reviewed separately.
_attr_should_poll = True
homeassistant/components/zhong_hong/manifest.json:9
- Restore the complete current PR template and select exactly one change type. The description uses an obsolete checklist, omits required items (including the dependency compare/changelog link and review-two-PRs checkbox), and checks both Dependency upgrade and Bugfix despite the template requiring one.
"requirements": ["zhong-hong-hvac==1.0.15"]
|
All green now. The test suite I added brought Remaining: only |
Breaking change
None.
Proposed change
The gateway connection in
zhong-hong-hvac1.0.13 can die silently: a status frame with an undefined fan speed value (0x00, observed after an indoor unit is switched off) crashes the library listener thread, and nothing restarts it. Entities then keep showing stale state forever with no health signal.zhong-hong-hvac1.0.15 fixes the library (tolerant parsing, listener self-healing, health probes, reconnect, and propagation of the send result through all control methods) and exposesZhongHongGateway.connected/HVAC.connected. This PR:zhong-hong-hvacto 1.0.15connected)Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
If the code communicates with devices, web services, or third-party tools:
requirements_all.txt.requirements_test_all.txt.