From 2cbe30509efe24837f639d17c710dd84698a99e6 Mon Sep 17 00:00:00 2001 From: sdb9696 Date: Mon, 17 Jun 2024 10:12:30 +0100 Subject: [PATCH] Use cli error function for device not supporting pairing output --- kasa/cli.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kasa/cli.py b/kasa/cli.py index 5a8b1481..036f5335 100755 --- a/kasa/cli.py +++ b/kasa/cli.py @@ -1316,8 +1316,7 @@ async def child_list(dev): async def child_pair(dev, timeout): """Pair new device.""" if (cs := dev.modules.get(Module.ChildSetup)) is None: - echo("%s does not support pairing." % dev) - return + error("%s does not support pairing." % dev) echo("Finding new devices for %s seconds" % 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): """Unpair given device.""" if (cs := dev.modules.get(Module.ChildSetup)) is None: - echo("%s does not support pairing." % dev) - return + error("%s does not support pairing." % dev) res = await cs.unpair(device_id=device_id) echo("Unpaired %s (if it was paired)" % device_id)