From a26378d5332d545a13993858db122409d4856f98 Mon Sep 17 00:00:00 2001 From: jens Date: Thu, 17 Dec 2020 17:43:52 +0100 Subject: [PATCH] - fixed stirrer test --- components/actor/stirrerpololu1376.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/actor/stirrerpololu1376.py b/components/actor/stirrerpololu1376.py index 9f733c8..08030af 100644 --- a/components/actor/stirrerpololu1376.py +++ b/components/actor/stirrerpololu1376.py @@ -1,3 +1,4 @@ +from contextlib import contextmanager from components import AStirrer import time import serial @@ -24,6 +25,14 @@ class StirrerPololu1376(AStirrer): self.ser_send('V') self.ser_recv() + @contextmanager + def remote_open(self): + try: + self.on_activate(True) + yield None + finally: + self.on_activate(False) + def ser_send(self, cmd): self.ser.write((cmd + '\r\n').encode())