Cancel timeout on stop

This commit is contained in:
Phil Howard
2020-07-20 20:45:17 +01:00
parent b4f2bc673a
commit 8178b66a80

View File

@@ -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.