fixes on small furnace
This commit is contained in:
@ -22,7 +22,7 @@ import os
|
||||
from glob import glob
|
||||
from frappy.core import Readable, Writable, Parameter, BoolType, StringType,\
|
||||
FloatRange, Property, TupleOf, ERROR, IDLE
|
||||
from frappy.errors import ConfigError
|
||||
from frappy.errors import ConfigError, OutOfRangeError
|
||||
from math import log
|
||||
|
||||
basepaths = '/sys/class/ionopimax', '/sys/class/ionopi'
|
||||
@ -121,8 +121,8 @@ class CurrentInput(AnalogInput):
|
||||
result = super().read_value()
|
||||
if self.x > 0.021:
|
||||
self.status = ERROR, 'sensor broken'
|
||||
else:
|
||||
self.status = IDLE, ''
|
||||
raise OutOfRangeError('sensor broken')
|
||||
self.status = IDLE, ''
|
||||
return result
|
||||
|
||||
|
||||
@ -146,3 +146,18 @@ class VoltageOutput(AnalogOutput):
|
||||
self.write(f'{self.addr}_mode', 'V')
|
||||
self.write(f'{self.addr}', '0')
|
||||
self.write(f'{self.addr}_enabled', '1')
|
||||
|
||||
|
||||
class VoltagePower(Base, Writable):
|
||||
devclass = 'power_out'
|
||||
target = Parameter(datatype=FloatRange(0, 24.5, unit='V'), default=12)
|
||||
addr = 'vso'
|
||||
|
||||
def write_target(self, value):
|
||||
if value:
|
||||
self.write(self.addr, value, 1000)
|
||||
self.write(f'{self.addr}_enabled', 1)
|
||||
else:
|
||||
self.write(f'{self.addr}_enabled', 0)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user