Index: dialin/dg/valves.py =================================================================== diff -u -r7b0e7a8562d035de041244e38e1811ddba69694b -r06b80e958bf06899c4bb1ba8980afd439a292d64 --- dialin/dg/valves.py (.../valves.py) (revision 7b0e7a8562d035de041244e38e1811ddba69694b) +++ dialin/dg/valves.py (.../valves.py) (revision 06b80e958bf06899c4bb1ba8980afd439a292d64) @@ -125,7 +125,7 @@ @return: 1 = energized, otherwise de-energized """ - if binary == 1: + if binary != 0: return ENERGIZED else: return DEENERGIZED @@ -143,17 +143,17 @@ # Extract each valve state from U16 valves states using bit-masking self.valve_state_VRF = self._binary_to_valve_state(vst[0] & 0x0001) self.valve_state_VRI = self._binary_to_valve_state(vst[0] & 0x0002) - self.valve_state_VRD = self._binary_to_valve_state(vst[0] & 0x0003) - self.valve_state_VRO = self._binary_to_valve_state(vst[0] & 0x0004) - self.valve_state_VPO = self._binary_to_valve_state(vst[0] & 0x0005) - self.valve_state_VBF = self._binary_to_valve_state(vst[0] & 0x0006) - self.valve_state_VRC = self._binary_to_valve_state(vst[0] & 0x0007) - self.valve_state_VDR = self._binary_to_valve_state(vst[0] & 0x0008) - self.valve_state_VPI = self._binary_to_valve_state(vst[0] & 0x0009) - self.valve_state_VSP = self._binary_to_valve_state(vst[0] & 0x0010) - self.valve_state_VR1 = self._binary_to_valve_state(vst[0] & 0x0011) - self.valve_state_VR2 = self._binary_to_valve_state(vst[0] & 0x0012) - self.valve_state_VPD = self._binary_to_valve_state(vst[0] & 0x0013) + self.valve_state_VRD = self._binary_to_valve_state(vst[0] & 0x0004) + self.valve_state_VRO = self._binary_to_valve_state(vst[0] & 0x0008) + self.valve_state_VPO = self._binary_to_valve_state(vst[0] & 0x0016) + self.valve_state_VBF = self._binary_to_valve_state(vst[0] & 0x0032) + self.valve_state_VRC = self._binary_to_valve_state(vst[0] & 0x0064) + self.valve_state_VDR = self._binary_to_valve_state(vst[0] & 0x0128) + self.valve_state_VPI = self._binary_to_valve_state(vst[0] & 0x0256) + self.valve_state_VSP = self._binary_to_valve_state(vst[0] & 0x0512) + self.valve_state_VR1 = self._binary_to_valve_state(vst[0] & 0x1024) + self.valve_state_VR2 = self._binary_to_valve_state(vst[0] & 0x2048) + self.valve_state_VPD = self._binary_to_valve_state(vst[0] & 0x4096) def cmd_valve_override(self, state, valve, reset=NO_RESET): """