mirror of
https://github.com/pimoroni/grow-python
synced 2025-10-25 15:19:23 +00:00
Cancel timeout on stop
This commit is contained in:
@@ -52,6 +52,9 @@ class Pump(object):
|
||||
def stop(self):
|
||||
"""Stop the pump."""
|
||||
self.set_speed(0)
|
||||
if self._timeout is not None:
|
||||
self._timeout.cancel()
|
||||
self._timeout = None
|
||||
|
||||
def dose(self, speed, timeout=0.1, blocking=True, force=False):
|
||||
"""Pulse the pump for timeout seconds.
|
||||
|
||||
Reference in New Issue
Block a user