Add childsetup module to smartcam hubs (#1469)

Add the `childsetup` module for `smartcam` hubs to allow pairing and unpairing child devices.
This commit is contained in:
Steven B.
2025-01-23 09:42:37 +00:00
committed by GitHub
parent bd43e0f7d2
commit 5e57f8bd6c
10 changed files with 278 additions and 39 deletions

View File

@@ -191,12 +191,12 @@ async def test_feature_setters(dev: Device, mocker: MockerFixture):
exceptions = []
for feat in dev.features.values():
try:
prot = (
feat.container._device.protocol
if feat.container
else feat.device.protocol
)
with patch.object(prot, "query", name=feat.id) as query:
patch_dev = feat.container._device if feat.container else feat.device
with (
patch.object(patch_dev.protocol, "query", name=feat.id) as query,
# patch update in case feature setter does an update
patch.object(patch_dev, "update"),
):
await _test_feature(feat, query)
# we allow our own exceptions to avoid mocking valid responses
except KasaException: