| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Some hubs intermittently return a getChildDeviceComponentList result without the child_component_list key. Seen on an H200 without any child device paired (firmware 1.7.7 Build 20260917): every update then failed with KeyError: 'child_component_list' in _create_delete_children and all of the hub entities became unavailable. Skip creating and deleting children for that update instead of failing. Treating the response as an empty list would delete the known children of a hub that has some, so they are kept until the next complete response.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #1797 +/- ##
=======================================
Coverage 93.41% 93.41%
=======================================
Files 159 159
Lines 10113 10116 +3
Branches 1043 1044 +1
=======================================
+ Hits 9447 9450 +3
Misses 472 472
Partials 194 194 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you @Richardtristan, let's get this in for the next release!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #1796
Problem
Some hubs intermittently return a getChildDeviceComponentList result without the child_component_list key. I hit this on an H200 with no child device paired (firmware 1.7.7 Build 20260917). Every update then failed in _create_delete_children() with KeyError: 'child_component_list', and all of the hub's entities became unavailable in Home Assistant.
The response is most likely an empty dict. A result without start_index/sum skips _handle_response_lists() and reaches _create_delete_children() unchanged.
Change
When the list is missing, children are neither created nor deleted for that update, and a debug message is logged. Treating the response as an empty list would delete the known children of a hub that has some, so they are kept until the next complete response.
Tests
test_dynamic_devices now also covers a component list response without the list:
Ran locally on tests/smart, tests/smartcam, tests/test_childdevice.py and tests/protocols: 4491 passed, 175 skipped. ruff check, ruff format --check and mypy pass on the changed files.
A one-line .get("child_component_list", []) version of this fix has been running on my H200 since the issue was opened, with no more errors.