FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

H200 hub without child devices: KeyError 'child_component_list' in _create_delete_children (0.11.0.1) · Issue #1796 · python-kasa/python-kasa · GitHub

Repository navigation

H200 hub without child devices: KeyError 'child_component_list' in _create_delete_children (0.11.0.1) #1796

Closed

Description

Description

Since upgrading Home Assistant to 2026.10.1 (which ships python-kasa==0.11.0.1), a Tapo H200 hub that has no child devices paired fails on almost every update with KeyError: 'child_component_list' in SmartDevice._create_delete_children(). All of its entities (siren, LED, alarm sound select) become unavailable. Reloading the config entry only helps for a few minutes.

A second H200 hub on the same network, with 8 child devices (T110 / T315) and firmware 1.7.5, is not affected.

Environment

  • python-kasa: 0.11.0.1, via Home Assistant 2026.10.1 (tplink integration). The same code is still on master.
  • Device: Tapo H200, hardware 1.0, firmware 1.7.7 Build 20260917 rel.79232, region EU, SMART.TAPOHUB
  • Child devices paired to this hub: none (it is only used as a siren)
  • Previous working setup: Home Assistant 2026.9.4. Failures started a few hours after the upgrade and then repeated on every poll (about every 8 s) for more than 24 h.

Traceback

ERROR (MainThread) [homeassistant.components.tplink.coordinator] Unexpected error fetching <hub ip> data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 456, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/tplink/coordinator.py", line 78, in _async_update_data
    await self.device.update(update_children=self._update_children)
  File "/usr/local/lib/python3.14/site-packages/kasa/smart/smartdevice.py", line 279, in update
    children_changed = await self._update_children_info()
  File "/usr/local/lib/python3.14/site-packages/kasa/smartcam/smartcamdevice.py", line 116, in _update_children_info
    changed = await self._create_delete_children(
        child_info, self._last_update["getChildDeviceComponentList"]
    )
  File "/usr/local/lib/python3.14/site-packages/kasa/smart/smartdevice.py", line 114, in _create_delete_children
    for child in child_device_components_resp["child_component_list"]
KeyError: 'child_component_list'

Observations

  • The failure is intermittent at the device level. A diagnostics dump taken at another moment shows well-formed empty responses:

    "getChildDeviceList": {"start_index": 0, "sum": 0, "child_device_list": []},
    "getChildDeviceComponentList": {"start_index": 0, "sum": 0, "child_component_list": []}

    So on an empty hub, this firmware sometimes returns a getChildDeviceComponentList result that has no child_component_list key, while getChildDeviceList is still a non-empty dict. I could not capture the malformed payload itself: the debug log does not include the raw response.

  • In SmartCamDevice._update_children_info(), the getChildDeviceList response goes through _try_get_response(..., {}), but getChildDeviceComponentList is indexed directly. _create_delete_children() then assumes the key is always there.

Suggested fix

Treat a missing component list as empty, the same way a missing child list is handled:

smart_children_components = {
    child["device_id"]: child
    for child in child_device_components_resp.get("child_component_list", [])
}

I applied this one-line change locally in kasa/smart/smartdevice.py. The hub has been stable since, with no more errors and entities available. It might also be worth using _try_get_response(self._last_update, "getChildDeviceComponentList", {}) in smartcamdevice.py.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL