Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
spacey-sooty committed Jun 24, 2024
1 parent f1f73d3 commit 5542347
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions commands2/button/trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,17 @@ def onChange(self, command: Command) -> Self:
:param command: the command t start
:returns: this trigger, so calls can be chained
"""
self._last_pressed = self._condition()

state = SimpleNamespace(pressed_last=self._condition())

@self._loop.bind
def _():
pressed = self._condition()

if this._last_pressed != pressed:
if self.pressed_last != pressed:
command.schedule()

this._last_pressed = pressed
self.pressed_last = pressed

return self

Expand Down

0 comments on commit 5542347

Please sign in to comment.