-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Add update platform to ZHA (bumps zigpy to 0.61.0) #107612
Add update platform to ZHA (bumps zigpy to 0.61.0) #107612
Conversation
Hey there @Adminiuga, @puddly, @TheJulianJES, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
This needs a Zigpy bump for the tests to pass |
70cb345
to
a7dcaec
Compare
Probably expected, clicking "check for updates" causes the update checks for sleeping/most battery-powered devices to time out and print an exception about how the message couldn't be delivered. Do we want to keep this, or like not print the exception in that case, just a simple warning it couldn't be queried? Home Assistant Logs (click to expand)2024-01-31 01:53:53.404 WARNING (MainThread) [homeassistant.helpers.entity] Update of update.ikea_of_sweden_tradfri_remote_control_firmware_2 is taking over 10 seconds
2024-01-31 01:53:53.405 WARNING (MainThread) [homeassistant.helpers.entity] Update of update.lumi_lumi_motion_ac02_firmware is taking over 10 seconds
2024-01-31 01:53:53.405 WARNING (MainThread) [homeassistant.helpers.entity] Update of update.lumi_lumi_motion_ac02_firmware_4 is taking over 10 seconds
[...]
2024-01-31 01:54:11.255 ERROR (MainThread) [homeassistant.helpers.entity] Update for update.ikea_of_sweden_tradfri_remote_control_firmware_2 fails
Traceback (most recent call last):
File "/Users/test/PycharmProjects/HomeAssistantcore/homeassistant/helpers/entity.py", line 942, in async_update_ha_state
await self.async_device_update()
File "/Users/test/PycharmProjects/HomeAssistantcore/homeassistant/helpers/entity.py", line 1259, in async_device_update
await self.async_update()
File "/Users/test/PycharmProjects/HomeAssistantcore/homeassistant/components/zha/update.py", line 143, in async_update
await self._ota_cluster_handler.async_check_for_update()
File "/Users/test/PycharmProjects/HomeAssistantcore/homeassistant/components/zha/core/cluster_handlers/general.py", line 585, in async_check_for_update
await self.cluster.image_notify(
File "/Users/test/PycharmProjects/HomeAssistantcore/venv/lib/python3.11/site-packages/zigpy/zcl/__init__.py", line 411, in reply
return await self._endpoint.reply(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/test/PycharmProjects/HomeAssistantcore/venv/lib/python3.11/site-packages/zigpy/endpoint.py", line 278, in reply
return await self.device.reply(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/test/PycharmProjects/HomeAssistantcore/venv/lib/python3.11/site-packages/zigpy/device.py", line 488, in reply
return await self.request(
^^^^^^^^^^^^^^^^^^^
File "/Users/test/PycharmProjects/HomeAssistantcore/venv/lib/python3.11/site-packages/zigpy/device.py", line 322, in request
await send_request()
File "/Users/test/PycharmProjects/HomeAssistantcore/venv/lib/python3.11/site-packages/zigpy/application.py", line 833, in request
await self.send_packet(
File "/Users/test/PycharmProjects/HomeAssistantcore/venv/lib/python3.11/site-packages/bellows/zigbee/application.py", line 931, in send_packet
raise zigpy.exceptions.DeliveryError(
zigpy.exceptions.DeliveryError: Failed to deliver message: <EmberStatus.DELIVERY_FAILED: 102> |
That’s expected. If you wanna update a battery device it needs to be woken up. |
I’d rather let the normal mechanics (and the error occur) but that can be changed during the beta if we feel it should be changed |
I also think that if we hide the exception that the failure toast message in the UI won't happen? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Successfully updated a Hue bulb and error handling also seems to work.
3b39f4c
to
2e9c48a
Compare
Huge thanks to @puddly and @TheJulianJES for helping with this!!!! |
codecov is unrelated |
Proposed change
This PR adds update entities to ZHA.
REQUIRES: zigpy/zigpy#1321
Zigpy bumped to 0.61.0: https://github.com/zigpy/zigpy/releases/tag/0.61.0
There is still a lot to do here:error handlingtestsdocs PRcode cleanupType 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:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.To help with the load of incoming pull requests: