Skip to content

Commit

Permalink
Fix bug in keepopen for buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
9gel authored and ppaeps committed Jul 5, 2024
1 parent 6f49723 commit d6bf249
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions dsl_buttons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ def button() -> None:
# toggle keep open (i.e. unlock)
keepopen = not keepopen
if keepopen:
lastopen = time.time()
print(
"unlock pressed, will open for %d seconds"
"unlock button pressed, will open for %d seconds"
% unlock_max_time,
flush=True,
)
r.publish("door_action", "OPEN")
else:
print("unlock pressed while unlocked, locking", flush=True)
print(
"unlock button pressed while unlocked, locking", flush=True
)
r.publish("door_action", "CLOSE")
elif d[3] == 0x36: # KEY_COMMA
# bell, TODO
Expand Down

0 comments on commit d6bf249

Please sign in to comment.