From bdfa1d1a38784f09490cd853bf1c70f4affdda29 Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Wed, 18 Mar 2026 13:44:16 +0100 Subject: [PATCH] frappy_psi.hepump: check conn. before reading digital inputs trinamic: export input3 if available Change-Id: Idacfb92a37ab8a8a5d7bb7502d23a9f3c6d962e7 --- frappy_psi/hepump.py | 8 +++++--- frappy_psi/trinamic.py | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frappy_psi/hepump.py b/frappy_psi/hepump.py index b88a44b3..6e9eb4fb 100644 --- a/frappy_psi/hepump.py +++ b/frappy_psi/hepump.py @@ -41,15 +41,17 @@ class HePump(Writable): self.valvemotor.write_output0(value) def read_target(self): - return self.valvemotor.read_output0() + if self.valvemotor.io.is_connected: + return self.valvemotor.read_output0() + return self.target def read_value(self): - if self.has_feedback: + if self.has_feedback and self.valvemotor.io.is_connected: return not self.valvemotor.read_input3() return self.target def read_eco_mode(self): - if self.pump_type == 'xds35': + if self.pump_type == 'xds35' and self.valvemotor.io.is_connected: return self.valvemotor.read_output1() return False diff --git a/frappy_psi/trinamic.py b/frappy_psi/trinamic.py index 850d02b9..514227a6 100644 --- a/frappy_psi/trinamic.py +++ b/frappy_psi/trinamic.py @@ -162,7 +162,9 @@ class Motor(PersistentMixin, HasIO, Drivable): if self.has_home: self.parameters['home'].export = '_home' self.setProperty('has_inputs', True) - if not self.has_inputs: + if self.has_inputs: + self.parameters['input3'].export = '_input3' + else: self.setProperty('with_pullup', False) def writeInitParams(self):