From 8e6996e3a8929c00583c45d1d474407acafe9695 Mon Sep 17 00:00:00 2001 From: Christian Zandee Date: Fri, 16 Sep 2022 22:50:16 +0200 Subject: [PATCH] Fixed issue with non-working unlock --- surepy/surecli/__init__.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/surepy/surecli/__init__.py b/surepy/surecli/__init__.py index f481003..347f615 100644 --- a/surepy/surecli/__init__.py +++ b/surepy/surecli/__init__.py @@ -414,15 +414,14 @@ async def locking(ctx: click.Context, device_id: int, mode: str, token: str | No else: return - if lock_state: - console.print(f"setting {flap.name} to '{state}'...") + console.print(f"setting {flap.name} to '{state}'...") - if await sp.sac._set_lock_state(device_id=device_id, mode=lock_state) and ( - device := await sp.get_device(device_id=device_id) - ): - console.print(f"✅ {device.name} set to '{state}' 🐾") - else: - console.print(f"❌ setting to '{state}' may have worked but something is fishy..!") + if await sp.sac._set_lock_state(device_id=device_id, mode=lock_state) and ( + device := await sp.get_device(device_id=device_id) + ): + console.print(f"✅ {device.name} set to '{state}' 🐾") + else: + console.print(f"❌ setting to '{state}' may have worked but something is fishy..!") # await sp.sac.close_session()