Skip to content

Commit d6bf249

Browse files
9gelppaeps
authored andcommitted
Fix bug in keepopen for buttons
1 parent 6f49723 commit d6bf249

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

dsl_buttons/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,17 @@ def button() -> None:
3838
# toggle keep open (i.e. unlock)
3939
keepopen = not keepopen
4040
if keepopen:
41+
lastopen = time.time()
4142
print(
42-
"unlock pressed, will open for %d seconds"
43+
"unlock button pressed, will open for %d seconds"
4344
% unlock_max_time,
4445
flush=True,
4546
)
4647
r.publish("door_action", "OPEN")
4748
else:
48-
print("unlock pressed while unlocked, locking", flush=True)
49+
print(
50+
"unlock button pressed while unlocked, locking", flush=True
51+
)
4952
r.publish("door_action", "CLOSE")
5053
elif d[3] == 0x36: # KEY_COMMA
5154
# bell, TODO

0 commit comments

Comments
 (0)