mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-12 10:28:01 +00:00
Add support for pairing devices with hubs (#859)
Co-authored-by: Steven B. <51370195+sdb9696@users.noreply.github.com>
This commit is contained in:
@@ -988,3 +988,24 @@ async def test_dynamic_devices(dev: Device, caplog: pytest.LogCaptureFixture):
|
||||
await dev.update()
|
||||
|
||||
assert "Could not find child id for device" not in caplog.text
|
||||
|
||||
|
||||
@hubs_smart
|
||||
async def test_unpair(dev: SmartDevice, mocker: MockerFixture):
|
||||
"""Verify that unpair calls childsetup module."""
|
||||
if not dev.children:
|
||||
pytest.skip("device has no children")
|
||||
|
||||
child = dev.children[0]
|
||||
|
||||
assert child.parent is not None
|
||||
assert Module.ChildSetup in dev.modules
|
||||
cs = dev.modules[Module.ChildSetup]
|
||||
|
||||
unpair_call = mocker.spy(cs, "unpair")
|
||||
|
||||
unpair_feat = child.features.get("unpair")
|
||||
assert unpair_feat
|
||||
await unpair_feat.set_value(None)
|
||||
|
||||
unpair_call.assert_called_with(child.device_id)
|
||||
|
Reference in New Issue
Block a user