8000 Fix update errors on hubs with unsupported children by sdb9696 · Pull Request #1344 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

Fix update errors on hubs with unsupported children #1344

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

Merged
merged 2 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
8000
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion kasa/smart/smartdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,14 @@
self._last_update, "get_child_device_list", {}
):
for info in child_info["child_device_list"]:
self._children[info["device_id"]]._update_internal_state(info)
child_id = info["device_id"]
if child_id not in self._children:
_LOGGER.debug(

Check warning on line 172 in kasa/smart/smartdevice.py

View check run for this annotation

Codecov / codecov/patch

kasa/smart/smartdevice.py#L172

Added line #L172 was not covered by tests
"Skipping child update for %s, probably unsupported device",
child_id,
)
continue

Check warning on line 176 in kasa/smart/smartdevice.py

View check run for this annotation

Codecov / codecov/patch

kasa/smart/smartdevice.py#L176

Added line #L176 was not covered by tests
self._children[child_id]._update_internal_state(info)

def _update_internal_info(self, info_resp: dict) -> None:
"""Update the internal device info."""
Expand Down
9 changes: 8 additions & 1 deletion kasa/smartcam/smartcamdevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,14 @@
self._last_update, "getChildDeviceList", {}
):
for info in child_info["child_device_list"]:
self._children[info["device_id"]]._update_internal_state(info)
child_id = info["device_id"]
if child_id not in self._children:
_LOGGER.debug(

Check warning on line 73 in kasa/smartcam/smartcamdevice.py

View check run for this annotation

Codecov / codecov/patch

kasa/smartcam/smartcamdevice.py#L73

Added line #L73 was not covered by tests
"Skipping child update for %s, probably unsupported device",
child_id,
)
continue

Check warning on line 77 in kasa/smartcam/smartcamdevice.py

View check run for this annotation

Codecov / codecov/patch

kasa/smartcam/smartcamdevice.py#L77

Added line #L77 was not covered by tests
self._children[child_id]._update_internal_state(info)

async def _initialize_smart_child(
self, info: dict, child_components: dict
Expand Down
Loading
0