Skip to content

Commit 5cf5abd

Browse files
committed
fix
1 parent 85f6bbd commit 5cf5abd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

commands2/button/trigger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def onChange(self, command: Command) -> Self:
136136
def _():
137137
pressed = self._condition()
138138

139-
if state.pressed_last != pressed:
139+
if state.pressed_last not pressed:
140140
command.schedule()
141141

142142
state.pressed_last = pressed

tests/test_trigger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_onChange(scheduler: commands2.CommandScheduler):
5656
assert command1.isScheduled()
5757
finished.set(True)
5858
scheduler.run()
59-
assert command1.isScheduled()
59+
assert not command1.isScheduled()
6060

6161

6262
def test_whileTrueRepeatedly(scheduler: commands2.CommandScheduler):

0 commit comments

Comments
 (0)