Index: leahi_dialin/ro/modules/valves.py =================================================================== diff -u -r92358e1fb33621653dffae4f9560c1d0982e8665 -rbefe788cdfef820b43ddcabef0e03877676bc452 --- leahi_dialin/ro/modules/valves.py (.../valves.py) (revision 92358e1fb33621653dffae4f9560c1d0982e8665) +++ leahi_dialin/ro/modules/valves.py (.../valves.py) (revision befe788cdfef820b43ddcabef0e03877676bc452) @@ -162,6 +162,7 @@ """ vst = struct.unpack('H', bytearray(message['message'][self.START_POS_VALVES_STATES:self.END_POS_VALVES_STATES])) + self.valve_states_all = vst[0] # Extract each valve state from U16 valves states using bit-masking self.valve_state_VWI["state"] = self._binary_to_valve_state(vst[0] & 1) self.valve_state_VROD["state"] = self._binary_to_valve_state(vst[0] & 2) @@ -172,26 +173,6 @@ self.valve_state_VCD["state"] = self._binary_to_valve_state(vst[0] & 64) self.valve_state_VFB["state"] = self._binary_to_valve_state(vst[0] & 128) - # Update the all valve states bit status - bits = 0x0000 - if self.valve_state_VWI["state"] != DEENERGIZED: - bits = bits | 1 - if self.valve_state_VROD["state"] != DEENERGIZED: - bits = bits | 2 - if self.valve_state_VFF["state"] != DEENERGIZED: - bits = bits | 4 - if self.valve_state_VPI["state"] != DEENERGIZED: - bits = bits | 8 - if self.valve_state_VCR["state"] != DEENERGIZED: - bits = bits | 16 - if self.valve_state_VCB["state"] != DEENERGIZED: - bits = bits | 32 - if self.valve_state_VCD["state"] != DEENERGIZED: - bits = bits | 64 - if self.valve_state_VFB["state"] != DEENERGIZED: - bits = bits | 128 - self.valve_states_all = bits - start = self.END_POS_VALVES_STATES end = start + 1 for valve_id in self.valves_sensed_states: