Skip to content

Commit

Permalink
Fixed issue with non-working unlock
Browse files Browse the repository at this point in the history
  • Loading branch information
czandee committed Sep 24, 2022
1 parent ff1e396 commit 8e6996e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions surepy/surecli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 8e6996e

Please # to comment.