From 52f90fe5be171c873d1cd36f8966af214331088b Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Thu, 5 Jun 2025 10:22:36 +0200 Subject: [PATCH] frappy_psi.manual_valves: make persistent and clean up Change-Id: Ifbdc886f556064745a7aaffbfdc1bad2ad74632e --- frappy_psi/manual_valves.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/frappy_psi/manual_valves.py b/frappy_psi/manual_valves.py index 6624068..997fbea 100644 --- a/frappy_psi/manual_valves.py +++ b/frappy_psi/manual_valves.py @@ -19,20 +19,14 @@ # # ***************************************************************************** -from frappy.core import Readable, Parameter, FloatRange, BoolType, StringIO, HasIO, \ - Property, StringType, Writable, IntRange, IDLE, BUSY, ERROR -from frappy.errors import CommunicationFailedError +from frappy.core import Parameter, BoolType, Writable +from frappy.persistent import PersistentMixin, PersistentParam -class ManualValve(Writable): - target = Parameter('Valve target', datatype = BoolType()) - value = Parameter('Valve state', datatype = BoolType()) - - def read_value(self): - return self.value + +class ManualValve(PersistentMixin, Writable): + target = PersistentParam('Valve target', datatype=BoolType(), persistent='auto') + value = Parameter('Valve state', datatype=BoolType()) def write_target(self, target): self.value = target return self.value - - def read_status(self): - return IDLE, ''