frappy_psi.manual_valves: make persistent and clean up

Change-Id: Ifbdc886f556064745a7aaffbfdc1bad2ad74632e
This commit is contained in:
2025-06-05 10:22:36 +02:00
parent 404b38d91a
commit 52f90fe5be

View File

@ -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, ''