mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
Use cli error function for device not supporting pairing output
This commit is contained in:
parent
fd68468f2e
commit
2cbe30509e
@ -1316,8 +1316,7 @@ async def child_list(dev):
|
|||||||
async def child_pair(dev, timeout):
|
async def child_pair(dev, timeout):
|
||||||
"""Pair new device."""
|
"""Pair new device."""
|
||||||
if (cs := dev.modules.get(Module.ChildSetup)) is None:
|
if (cs := dev.modules.get(Module.ChildSetup)) is None:
|
||||||
echo("%s does not support pairing." % dev)
|
error("%s does not support pairing." % dev)
|
||||||
return
|
|
||||||
|
|
||||||
echo("Finding new devices for %s seconds" % timeout)
|
echo("Finding new devices for %s seconds" % timeout)
|
||||||
return await cs.pair(timeout=timeout)
|
return await cs.pair(timeout=timeout)
|
||||||
@ -1329,8 +1328,7 @@ async def child_pair(dev, timeout):
|
|||||||
async def child_unpair(dev, device_id: str):
|
async def child_unpair(dev, device_id: str):
|
||||||
"""Unpair given device."""
|
"""Unpair given device."""
|
||||||
if (cs := dev.modules.get(Module.ChildSetup)) is None:
|
if (cs := dev.modules.get(Module.ChildSetup)) is None:
|
||||||
echo("%s does not support pairing." % dev)
|
error("%s does not support pairing." % dev)
|
||||||
return
|
|
||||||
|
|
||||||
res = await cs.unpair(device_id=device_id)
|
res = await cs.unpair(device_id=device_id)
|
||||||
echo("Unpaired %s (if it was paired)" % device_id)
|
echo("Unpaired %s (if it was paired)" % device_id)
|
||||||
|
Loading…
Reference in New Issue
Block a user