diff --git a/cfg/kapillarheizung_cfg.py b/cfg/kapillarheizung_cfg.py index eee22d13..18bd5b9f 100644 --- a/cfg/kapillarheizung_cfg.py +++ b/cfg/kapillarheizung_cfg.py @@ -79,7 +79,7 @@ Mod('Cernox', 'frappy_psi.logo.TempSensor', 'sensor', io = 'io', - vm_address ="VW14", + vm_address ="VW16", ) Mod('T_cx', @@ -107,7 +107,7 @@ Mod('HeaterState', vm_address_off = "V1246.1", ) ''' - +""" Mod('HeaterState', 'frappy_psi.logo.HeaterParam', 'heater state', @@ -121,9 +121,9 @@ Mod('HeaterState_a', io = 'io', vm_address = "V0.0", ) +""" -''' Mod('HeaterState', 'frappy_psi.logo.ControlHeater', 'heater state', @@ -137,7 +137,6 @@ Mod('HeaterState_a', io = 'io', vm_address = "V0.0", ) -''' # currently unused: diff --git a/frappy_psi/logo.py b/frappy_psi/logo.py index 6824714d..dd265723 100644 --- a/frappy_psi/logo.py +++ b/frappy_psi/logo.py @@ -144,7 +144,6 @@ class TempSensor(Snap7Mixin, Readable): class HeaterParam(Snap7Mixin, Writable): vm_address = Property('VM address output', datatype= StringType()) - target = Parameter('Heater target', datatype = FloatRange(unit='%')) value = Parameter('Heater Param', datatype = FloatRange(unit='%')) @@ -156,3 +155,21 @@ class HeaterParam(Snap7Mixin, Writable): def read_status(self): return IDLE, '' + + +class ControlHeater(Snap7Mixin, Writable): + vm_address = Property('VM address on switch', datatype= StringType()) + target = Parameter('Heater state', datatype = BoolType()) + value = Parameter('Heater state', datatype = BoolType()) + + def read_value(self): + return self.get_vm_value(self.vm_address) + + def write_target(self, target): + if (target): + return self.set_vm_value(self.vm_address, True) + else: + return self.set_vm_value(self.vm_address, False) + + def read_status(self): + return IDLE, ''