mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
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:
@@ -48,7 +48,10 @@ class ChildSetup(SmartModule):
|
||||
detected = await self._get_detected_devices()
|
||||
|
||||
if not detected["child_device_list"]:
|
||||
_LOGGER.info("No devices found.")
|
||||
_LOGGER.warning(
|
||||
"No devices found, make sure to activate pairing "
|
||||
"mode on the devices to be added."
|
||||
)
|
||||
return []
|
||||
|
||||
_LOGGER.info(
|
||||
@@ -63,7 +66,7 @@ class ChildSetup(SmartModule):
|
||||
|
||||
async def unpair(self, device_id: str) -> dict:
|
||||
"""Remove device from the hub."""
|
||||
_LOGGER.debug("Going to unpair %s from %s", device_id, self)
|
||||
_LOGGER.info("Going to unpair %s from %s", device_id, self)
|
||||
|
||||
payload = {"child_device_list": [{"device_id": device_id}]}
|
||||
return await self.call("remove_child_device_list", payload)
|
||||
|
Reference in New Issue
Block a user