Skip to content

Commit

Permalink
WIP: handler.py
Browse files Browse the repository at this point in the history
  • Loading branch information
FRESH-SHIN committed Dec 17, 2023
1 parent 4ee3e76 commit 26a2712
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nlabosesamebot/sesame/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ async def connect(self):
await self.device.wait_for_login()
async def unlock(self):
logging.debug("opening")
if self.device is None:
if self.device is None or not (self.device.getDeviceStatus() == CHSesame2Status.Unlocked or self.device.getDeviceStatus() == CHSesame2Status.Locked) :
await self.connect()
await self.device.unlock(history_tag="My Script")
await self.device.unlock(history_tag="Discord")

async def lock(self):
logging.debug("closing")
if self.device is None:
if self.device is None or not (self.device.getDeviceStatus() == CHSesame2Status.Unlocked or self.device.getDeviceStatus() == CHSesame2Status.Locked) :
await self.connect()
await self.device.lock(history_tag="My Script")
await self.device.lock(history_tag="Discord")

0 comments on commit 26a2712

Please sign in to comment.