When trying to set up a Tapo H200 Hub (with no child devices attached), the integration crashes during `_initialize_children()` with `RuntimeError: coroutine raised StopIteration`. · Issue #1728 · python-kasa/python-kasa · GitHub
When trying to set up a Tapo H200 Hub (with no child devices attached), the integration crashes during _initialize_children() with RuntimeError: coroutine raised StopIteration. #1728
Five edits across three files. The first adds a guard; the other four are the same substitution (direct index -> .get(key, [])), which behaves identically when the key is present, so hubs with paired children are unaffected.
1. kasa/protocols/smartprotocol.py, in _handle_response_lists
+ if list_sum == 0:+ return+
response_list_name = next(
iter(
2. kasa/smart/smartdevice.py
- for child in child_device_components_resp["child_component_list"]+ for child in child_device_components_resp.get("child_component_list", [])
3. kasa/smart/smartdevice.py
- for info in child_device_resp["child_device_list"]:+ for info in child_device_resp.get("child_device_list", []):
4. kasa/smart/smartdevice.py
- for info in child_info["child_device_list"]:+ for info in child_info.get("child_device_list", []):
5. kasa/smartcam/smartcamdevice.py
- for info in child_info["child_device_list"]:+ for info in child_info.get("child_device_list", []):
With all five applied, state completes cleanly on an empty hub, the device is usable, and the siren features (test_alarm / stop_alarm) work as expected. Behaviour with paired children is unchanged.
Activity
hubb22 commented on Aug 15, 2026
Solution for this issue:
Five edits across three files. The first adds a guard; the other four are the same substitution (direct index -> .get(key, [])), which behaves identically when the key is present, so hubs with paired children are unaffected.
1. kasa/protocols/smartprotocol.py, in _handle_response_lists
2. kasa/smart/smartdevice.py
3. kasa/smart/smartdevice.py
4. kasa/smart/smartdevice.py
5. kasa/smartcam/smartcamdevice.py
With all five applied, state completes cleanly on an empty hub, the device is usable, and the siren features (test_alarm / stop_alarm) work as expected. Behaviour with paired children is unchanged.
ben-jardine commented on Sep 26, 2026
Can confirm, the fix above does work for a H200.
My H200 versions are:
And I have also been getting the same error: RuntimeError: coroutine raised StopIteration during _initialize_children() / _handle_response_lists().
Applied the five changes described above to a local checkout of python-kasa and tested it directly against the H200.
The patched version now completes successfully:
The H200 exposed the expected functionality.
rossowl commented on Sep 30, 2026
Yes, it works for me too.