frappy_psi.manual_valves: make persistent and clean up
Change-Id: Ifbdc886f556064745a7aaffbfdc1bad2ad74632e
This commit is contained in:
@ -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())
|
||||
|
||||
class ManualValve(PersistentMixin, Writable):
|
||||
target = PersistentParam('Valve target', datatype=BoolType(), persistent='auto')
|
||||
value = Parameter('Valve state', datatype=BoolType())
|
||||
|
||||
def read_value(self):
|
||||
return self.value
|
||||
|
||||
def write_target(self, target):
|
||||
self.value = target
|
||||
return self.value
|
||||
|
||||
def read_status(self):
|
||||
return IDLE, ''
|
||||
|
Reference in New Issue
Block a user