Skip to content

Commit

Permalink
Merge pull request #155 from czandee/bugfix/unlock-not-working
Browse files Browse the repository at this point in the history
Fixed issue with non-working unlock
  • Loading branch information
benleb authored Apr 4, 2023
2 parents 373cb31 + 8e6996e commit cf3fcf4
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 cf3fcf4

Please # to comment.