Index: dialin/dg/accelerometer.py =================================================================== diff -u -r0f4ba40a63c79697d979203f67ef0338a12cae23 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/accelerometer.py (.../accelerometer.py) (revision 0f4ba40a63c79697d979203f67ef0338a12cae23) +++ dialin/dg/accelerometer.py (.../accelerometer.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -204,7 +204,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_accel_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_accel_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the accelerometer broadcast interval override command Constraints: Index: dialin/dg/calibration_record.py =================================================================== diff -u -r46ebf93d3666db40f25ad1e9170426853aa845d4 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/calibration_record.py (.../calibration_record.py) (revision 46ebf93d3666db40f25ad1e9170426853aa845d4) +++ dialin/dg/calibration_record.py (.../calibration_record.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -61,7 +61,7 @@ self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_dg_calibration_sync) - def cmd_request_dg_calibration_record(self): + def cmd_request_dg_calibration_record(self) -> bool: """ Handles getting DG calibration_record record from firmware. @@ -137,7 +137,7 @@ """ self.logger.debug("Received a complete dg calibration record.") - def cmd_set_dg_calibration_record(self, dg_calibration_record: OrderedDict): + def cmd_set_dg_calibration_record(self, dg_calibration_record: OrderedDict) -> bool: """ Handles updating the DG calibration record with the newest calibration_record data of a hardware and sends it to FW. Index: dialin/dg/concentrate_pumps.py =================================================================== diff -u -r0f4ba40a63c79697d979203f67ef0338a12cae23 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/concentrate_pumps.py (.../concentrate_pumps.py) (revision 0f4ba40a63c79697d979203f67ef0338a12cae23) +++ dialin/dg/concentrate_pumps.py (.../concentrate_pumps.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -95,7 +95,7 @@ self.concentrate_pump_cp2_current_set_speed = cp2_current[0] self.concentrate_pump_cp2_measured_speed = cp2_measured[0] - def cmd_concentrate_pump_state_change_request(self, pump_id, on=False): + def cmd_concentrate_pump_state_change_request(self, pump_id: int, on: bool = False) -> int: """ Constructs and sends the concentrate pump state change request command @@ -200,7 +200,7 @@ self.logger.error("Timeout!!!!") return False - def cmd_concentrate_pump_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_concentrate_pump_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the concentrate pump data broadcast interval override command Index: dialin/dg/conductivity_sensors.py =================================================================== diff -u -r0f4ba40a63c79697d979203f67ef0338a12cae23 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/conductivity_sensors.py (.../conductivity_sensors.py) (revision 0f4ba40a63c79697d979203f67ef0338a12cae23) +++ dialin/dg/conductivity_sensors.py (.../conductivity_sensors.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -136,7 +136,7 @@ self.logger.error("Timeout!!!!") return False - def cmd_conductivity_sensor_data_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_conductivity_sensor_data_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the conductivity sensor data broadcast interval override command Index: dialin/dg/dialysate_generator.py =================================================================== diff -u -rbfb0c47181dc8a73d09825ab697a7799dd520417 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/dialysate_generator.py (.../dialysate_generator.py) (revision bfb0c47181dc8a73d09825ab697a7799dd520417) +++ dialin/dg/dialysate_generator.py (.../dialysate_generator.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -252,7 +252,7 @@ self.dg_operation_mode = mode[0] self.dg_operation_sub_mode = smode[0] - def cmd_log_in_to_dg(self, resend: bool = False): + def cmd_log_in_to_dg(self, resend: bool = False) -> int: """ Constructs and sends a login command via CAN bus. Login required before \n other commands can be sent to the DG. @@ -280,7 +280,7 @@ self.logger.error("Timeout!!!!") return False - def cmd_ui_request_dg_version(self): + def cmd_ui_request_dg_version(self) -> None: """ Constructs and sends the ui request for version message @@ -293,12 +293,10 @@ self.can_interface.send(message, 0) - def cmd_dg_safety_shutdown_override(self): + def cmd_dg_safety_shutdown_override(self) -> int: """ Constructs and sends an DG safety shutdown override command via CAN bus. - \returns response message if received, False if no response received - @return: 1 if successful, zero otherwise """ @@ -320,7 +318,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_dg_software_reset_request(self): + def cmd_dg_software_reset_request(self) -> None: """ Constructs and sends an DG software reset request via CAN bus. Constraints: Index: dialin/dg/drain_pump.py =================================================================== diff -u -r4820f43868c7de63a8c5777b10f47152ce76103f -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/drain_pump.py (.../drain_pump.py) (revision 4820f43868c7de63a8c5777b10f47152ce76103f) +++ dialin/dg/drain_pump.py (.../drain_pump.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -112,7 +112,7 @@ self.drain_pump_state = state self.current_drain_pump_rpm = curr_rpm - def cmd_drain_pump_speed_set_point_override(self, speed): + def cmd_drain_pump_speed_set_point_override(self, speed: int) -> int: """ Constructs and sends the drain pump speed set point override command Constraints: @@ -145,7 +145,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_drain_pump_data_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_drain_pump_data_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the drain pump speed set point override command. Constraints: Index: dialin/dg/fans.py =================================================================== diff -u -rf053467ac7cfb9fe349e394342d3a9253a377403 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/fans.py (.../fans.py) (revision f053467ac7cfb9fe349e394342d3a9253a377403) +++ dialin/dg/fans.py (.../fans.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -137,7 +137,7 @@ self.outlet_2_rpm = outlet_2_rpm self.outlet_3_rpm = outlet_3_rpm - def cmd_fans_data_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_fans_data_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the fans data publish interval. Constraints: Index: dialin/dg/fluid_leak.py =================================================================== diff -u -r38667968d909c5991b9cf2f6c4d9c10c17e7ea4f -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/fluid_leak.py (.../fluid_leak.py) (revision 38667968d909c5991b9cf2f6c4d9c10c17e7ea4f) +++ dialin/dg/fluid_leak.py (.../fluid_leak.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -73,7 +73,7 @@ self.fluid_leak_state = state[0] - def cmd_fluid_leak_detector_override(self, detected, reset=NO_RESET): + def cmd_fluid_leak_detector_override(self, detected: int, reset: int = NO_RESET) -> int: """ Constructs and sends the fluid leak detector state override command Constraints: @@ -106,7 +106,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_fluid_leak_state_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_fluid_leak_state_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the fluid leak state broadcast interval override command Constraints: Index: dialin/dg/hd_proxy.py =================================================================== diff -u -rf053467ac7cfb9fe349e394342d3a9253a377403 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/hd_proxy.py (.../hd_proxy.py) (revision f053467ac7cfb9fe349e394342d3a9253a377403) +++ dialin/dg/hd_proxy.py (.../hd_proxy.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -46,19 +46,19 @@ self.can_interface = can_interface self.logger = logger - def cmd_switch_reservoirs(self, reservoirID=RESERVOIR1): + def cmd_switch_reservoirs(self, reservoirID: int = RESERVOIR1) -> int: """ Constructs and sends the switch reservoirs command. Constraints: DG must be in re-circulate mode. Given reservoirID must be in the reservoir list below. - @param reservoirID: unsigned int - reservoir to set as active (HD will draw from this reservoir). - @return: 1 if successful, zero otherwise - - \details Reservoir IDs: \n + Reservoir IDs: \n 0 = RESERVOIR 1 \n 1 = RESERVOIR 2 \n + + @param reservoirID: unsigned int - reservoir to set as active (HD will draw from this reservoir). + @return: 1 if successful, zero otherwise """ res = integer_to_bytearray(reservoirID) @@ -81,7 +81,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_fill(self, volume=1500, start=1): + def cmd_fill(self, volume: int = 1500, start: int = 1) -> int: """ Constructs and sends the fill command. Constraints: @@ -112,7 +112,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_drain(self, volume=200, tareLoadCell=False): + def cmd_drain(self, volume: int = 200, tareLoadCell: bool = False) -> int: """ Constructs and sends the drain command. Constraints: @@ -145,7 +145,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_start_stop_dg(self, start=True): + def cmd_start_stop_dg(self, start: bool = True) -> int: """ Constructs and sends the start/stop DG command Constraints: @@ -181,7 +181,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_start_stop_trimmer_heater(self, start=True): + def cmd_start_stop_trimmer_heater(self, start: bool = True) -> int: """ Constructs and sends the start/stop DG trimmer heater command @@ -214,7 +214,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_start_heat_disinfection(self): + def cmd_start_heat_disinfection(self) -> None: """ Constructs and sends start heat disinfect command Constraints: @@ -228,9 +228,9 @@ message_id=MsgIds.MSG_ID_DG_START_STOP_HEAT_DISINFECT.value, payload=payload) self.logger.debug("Starting heat disinfection process") - received_message = self.can_interface.send(message) + self.can_interface.send(message) - def cmd_stop_heat_disinfection(self): + def cmd_stop_heat_disinfection(self) -> None: """ Constructs and sends stop heat disinfect command Constraints: @@ -244,9 +244,9 @@ message_id=MsgIds.MSG_ID_DG_START_STOP_HEAT_DISINFECT.value, payload=payload) self.logger.debug("Stopping heat disinfection process") - received_message = self.can_interface.send(message) + self.can_interface.send(message) - def cmd_stop_primary_heater(self): + def cmd_stop_primary_heater(self) -> None: """ Constructs and sends stop heat disinfect command @@ -260,7 +260,7 @@ self.logger.debug("Stopping heat disinfection process") self.can_interface.send(message, 0) - def cmd_sample_water(self, cmd): + def cmd_sample_water(self, cmd: int) -> None: """ Constructs and sends sample water command Index: dialin/dg/heat_disinfect.py =================================================================== diff -u -rdd42e4d9cfe821b0a755ccc86cc1a4a2a3dd2f37 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/heat_disinfect.py (.../heat_disinfect.py) (revision dd42e4d9cfe821b0a755ccc86cc1a4a2a3dd2f37) +++ dialin/dg/heat_disinfect.py (.../heat_disinfect.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -106,7 +106,7 @@ self.r1_level = r1 self.r2_level = r2 - def cmd_start_stop_heat_disinfect(self, start=True): + def cmd_start_stop_heat_disinfect(self, start: bool = True) -> int: """ Constructs and sends the start/stop DG heat disinfection command Index: dialin/dg/heaters.py =================================================================== diff -u -r18c04cbcd10619250868cec39470a2b29c86121b -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/heaters.py (.../heaters.py) (revision 18c04cbcd10619250868cec39470a2b29c86121b) +++ dialin/dg/heaters.py (.../heaters.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -101,7 +101,7 @@ self.small_primary_heater_duty_cycle = small_primary_heater_pwm[0] self.trimmer_heater_duty_cycle = trimmer_heater_pwm[0] - def cmd_start_stop_primary_heater(self, state=HeatersStartStop.STOP.name): + def cmd_start_stop_primary_heater(self, state: int = HeatersStartStop.STOP.name) -> None: """ Constructs and sends a start/stop primary heater command Constraints: @@ -124,7 +124,7 @@ self.logger.debug(operation + " the Primary heater") self.can_interface.send(message, 0) - def cmd_start_stop_trimmer_heater(self, state=HeatersStartStop.STOP.name): + def cmd_start_stop_trimmer_heater(self, state: int = HeatersStartStop.STOP.name) -> None: """ Constructs and sends start trimmer heater command Constraints: @@ -147,7 +147,9 @@ self.logger.debug(operation + " the Primary heater") self.can_interface.send(message, 0) - def cmd_set_dialysate_target_temperature(self, primary_target_temp=37.0, trimmer_target_temp=38.0): + def cmd_set_dialysate_target_temperature(self, + primary_target_temp: float = 37.0, + trimmer_target_temp: float = 38.0) -> None: """ Constructs and sends primary and trimmer heater target temperature @@ -165,7 +167,7 @@ trimmer_target_temp)) self.can_interface.send(message, 0) - def cmd_heaters_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_heaters_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends broadcast time interval. Constraints: Index: dialin/dg/load_cells.py =================================================================== diff -u -r0f4ba40a63c79697d979203f67ef0338a12cae23 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/load_cells.py (.../load_cells.py) (revision 0f4ba40a63c79697d979203f67ef0338a12cae23) +++ dialin/dg/load_cells.py (.../load_cells.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -128,7 +128,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_load_cell_data_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_load_cell_data_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the load cell data broadcast interval override command Constraints: Index: dialin/dg/pressures.py =================================================================== diff -u -r0f4ba40a63c79697d979203f67ef0338a12cae23 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/pressures.py (.../pressures.py) (revision 0f4ba40a63c79697d979203f67ef0338a12cae23) +++ dialin/dg/pressures.py (.../pressures.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -102,16 +102,16 @@ Must be logged into DG. Given sensor must be one of the sensors listed below. - @param sensor: unsigned int - sensor ID - @param pressure: unsigned int - pressure (in PSI) - @param reset: integer - 1 to reset a previous override, 0 to override - @return: 1 if successful, zero otherwise - - \details pressure sensor IDs: \n + pressure sensor IDs: \n 0 = RO Pump Inlet \n 1 = RO Pump Outlet \n 2 = Drain Pump Inlet \n 3 = Drain Pump Outlet \n + + @param sensor: unsigned int - sensor ID + @param pressure: unsigned int - pressure (in PSI) + @param reset: integer - 1 to reset a previous override, 0 to override + @return: 1 if successful, zero otherwise """ rst = integer_to_bytearray(reset) @@ -136,7 +136,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_pressure_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_pressure_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the pressure override command. Constraints: Index: dialin/dg/reservoirs.py =================================================================== diff -u -r5120ddfc3108ba5b8280adf73c4523c11feb935b -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/reservoirs.py (.../reservoirs.py) (revision 5120ddfc3108ba5b8280adf73c4523c11feb935b) +++ dialin/dg/reservoirs.py (.../reservoirs.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -77,7 +77,7 @@ """ return self.drain_to_vol_ml - def cmd_switch_reservoirs(self, reservoir: int): + def cmd_switch_reservoirs(self, reservoir: int) -> bool: """ Sends a command to the DG to switch reservoirs @param reservoir: (int) the new reservoir number Index: dialin/dg/ro_pump.py =================================================================== diff -u -rf053467ac7cfb9fe349e394342d3a9253a377403 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/ro_pump.py (.../ro_pump.py) (revision f053467ac7cfb9fe349e394342d3a9253a377403) +++ dialin/dg/ro_pump.py (.../ro_pump.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -114,7 +114,7 @@ self.pwm_duty_cycle_pct = pwm self.ro_pump_state = ROPumpStates(ro_state).name if ROPumpStates.has_value(ro_state) else 'State Unknown' - def cmd_ro_pump_set_point_override(self, pressure, reset=NO_RESET): + def cmd_ro_pump_set_point_override(self, pressure: int, reset: int = NO_RESET) -> int: """ Constructs and sends the RO pump set point override command. Constraints: @@ -154,8 +154,15 @@ self.logger.debug("Timeout!!!!") return False - def cmd_ro_pump_duty_cycle_pct(self, duty): - # TODO add comments + def cmd_ro_pump_duty_cycle_pct(self, duty: float) -> int: + """ + Constructs and sends the set RO pump duty cycle message + Constraints: + Must be logged into DG. + + @param duty: integer - 1 percentage for duty cycle between 0 and 100 + @return: 1 if successful, zero otherwise + """ dc = float_to_bytearray(duty/100) payload = dc @@ -180,7 +187,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_ro_flow_rate_override(self, flow, reset=NO_RESET): + def cmd_ro_flow_rate_override(self, flow: float, reset: int = NO_RESET) -> int: """ Constructs and sends the RO rate override command. Constraints: @@ -220,7 +227,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_ro_pump_data_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_ro_pump_data_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the RO pump set point override command Constraints: Index: dialin/dg/scheduled_runs_record.py =================================================================== diff -u -r04d9678a26c46fe1567d9e8eecd80414a94ee4bc -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/scheduled_runs_record.py (.../scheduled_runs_record.py) (revision 04d9678a26c46fe1567d9e8eecd80414a94ee4bc) +++ dialin/dg/scheduled_runs_record.py (.../scheduled_runs_record.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -76,7 +76,7 @@ self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_dg_scheduled_runs_record) - def cmd_request_dg_scheduled_runs_record(self): + def cmd_request_dg_scheduled_runs_record(self) -> int: """ Handles getting DG scheduled runs record from firmware. @@ -302,7 +302,7 @@ return number_of_bytes - def cmd_set_dg_scheduled_runs_record(self, dg_scheduled_runs_record: OrderedDict): + def cmd_set_dg_scheduled_runs_record(self, dg_scheduled_runs_record: OrderedDict) -> bool: """ Handles updating the DG system record with the newest calibration_record data of a hardware and sends it to FW. Index: dialin/dg/service_record.py =================================================================== diff -u -re0aac8af8cd14024b89f241bb7b92ddd9bc4956e -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/service_record.py (.../service_record.py) (revision e0aac8af8cd14024b89f241bb7b92ddd9bc4956e) +++ dialin/dg/service_record.py (.../service_record.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -56,7 +56,7 @@ self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_dg_service_sync) - def cmd_request_dg_service_record(self): + def cmd_request_dg_service_record(self) -> int: """ Handles getting DG service record from firmware. @@ -134,7 +134,7 @@ """ self.logger.debug("Received a complete dg service record.") - def cmd_set_dg_service_record(self, dg_service_record: OrderedDict): + def cmd_set_dg_service_record(self, dg_service_record: OrderedDict) -> bool: """ Handles updating the DG service record and sends it to FW. Index: dialin/dg/system_record.py =================================================================== diff -u -re0aac8af8cd14024b89f241bb7b92ddd9bc4956e -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/system_record.py (.../system_record.py) (revision e0aac8af8cd14024b89f241bb7b92ddd9bc4956e) +++ dialin/dg/system_record.py (.../system_record.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -62,7 +62,7 @@ msg_id = MsgIds.MSG_ID_DG_SEND_SYSTEM_RECORD.value self.can_interface.register_receiving_publication_function(channel_id, msg_id, self._handler_dg_system_sync) - def cmd_request_dg_system_record(self): + def cmd_request_dg_system_record(self) -> int: """ Handles getting DG system record from firmware. @@ -140,7 +140,7 @@ """ self.logger.debug("Received a complete dg system record.") - def cmd_set_dg_system_record(self, dg_system_record: OrderedDict): + def cmd_set_dg_system_record(self, dg_system_record: OrderedDict) -> bool: """ Handles updating the DG system and sends it to FW. Index: dialin/dg/temperature_sensors.py =================================================================== diff -u -r0f4ba40a63c79697d979203f67ef0338a12cae23 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/temperature_sensors.py (.../temperature_sensors.py) (revision 0f4ba40a63c79697d979203f67ef0338a12cae23) +++ dialin/dg/temperature_sensors.py (.../temperature_sensors.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -169,7 +169,7 @@ message['message'][MsgFieldPositions.START_POS_FIELD_18:MsgFieldPositions.END_POS_FIELD_18]))[0] self.temperature_sensors[TemperatureSensorsNames.INTERNAL_COND_TEMP_SENSOR.name] = sensors_data - def cmd_temperature_sensors_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_temperature_sensors_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends broadcast time interval. Constraints: Index: dialin/dg/thermistors.py =================================================================== diff -u -r0f4ba40a63c79697d979203f67ef0338a12cae23 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/thermistors.py (.../thermistors.py) (revision 0f4ba40a63c79697d979203f67ef0338a12cae23) +++ dialin/dg/thermistors.py (.../thermistors.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -100,7 +100,7 @@ self.logger.debug("Themristors value override Timeout!!!") return False - def cmd_thermistors_data_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_thermistors_data_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the thermistors data publish interval command. Constraints: Index: dialin/dg/uv_reactors.py =================================================================== diff -u -r0f4ba40a63c79697d979203f67ef0338a12cae23 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/uv_reactors.py (.../uv_reactors.py) (revision 0f4ba40a63c79697d979203f67ef0338a12cae23) +++ dialin/dg/uv_reactors.py (.../uv_reactors.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -111,7 +111,7 @@ self.outlet_uv_reactor_state = ReactorsStates(outlet_state).name if ReactorsStates.has_value(outlet_state)\ else 'Outlet UV reactor state unknown' - def cmd_uv_reactors_data_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_uv_reactors_data_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the UV reactors data publish interval. Constraints: @@ -182,14 +182,14 @@ self.logger.debug("UV reactors health override Timeout!!!") return False - def cmd_start_stop_inlet_uv_reactor(self, state=ReactorsStates.UV_REACTOR_STATE_OFF.name): + def cmd_start_stop_inlet_uv_reactor(self, state: int = ReactorsStates.UV_REACTOR_STATE_OFF.value) -> int: """ Constructs and sends a start/stop command to the DG inlet UV reactor - @param: state: (int) the state of the inlet UV reactor. 0 for Off and 1 for On. + @param: state: (int) the state of the inlet UV reactor. 0 for Off (default) and 1 for On. @return: 1 if successful, zero otherwise """ - if state == ReactorsStates.UV_REACTOR_STATE_ON.name: + if state == ReactorsStates.UV_REACTOR_STATE_ON.value: payload = integer_to_bytearray(1) operation = 'Turning on ' else: @@ -211,14 +211,14 @@ self.logger.debug(operation + "inlet UV reactor timeout!!") return False - def cmd_start_stop_outlet_uv_reactor(self, state=ReactorsStates.UV_REACTOR_STATE_OFF.name): + def cmd_start_stop_outlet_uv_reactor(self, state: int = ReactorsStates.UV_REACTOR_STATE_OFF.value) -> int: """ Constructs and sends a start/stop command to the DG outlet UV reactor - @param: state: (int) the state of the outlet UV reactor. 0 for Off and 1 for On. + @param: state: (int) the state of the outlet UV reactor. 0 for Off (default) and 1 for On. @return: 1 if successful, zero otherwise """ - if state == ReactorsStates.UV_REACTOR_STATE_ON: + if state == ReactorsStates.UV_REACTOR_STATE_ON.value: payload = integer_to_bytearray(1) operation = 'Turning on ' else: Index: dialin/dg/valves.py =================================================================== diff -u -r0f4ba40a63c79697d979203f67ef0338a12cae23 -r8a13a85045edfcf69bf0e728d294f04b924d732c --- dialin/dg/valves.py (.../valves.py) (revision 0f4ba40a63c79697d979203f67ef0338a12cae23) +++ dialin/dg/valves.py (.../valves.py) (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -333,7 +333,7 @@ self.logger.debug("Timeout!!!!") return False - def cmd_valve_broadcast_interval_override(self, ms, reset=NO_RESET): + def cmd_valve_broadcast_interval_override(self, ms: int, reset: int = NO_RESET) -> int: """ Constructs and sends the valve state override command. Constraints: Index: tests/unit_tests/run_all.sh =================================================================== diff -u --- tests/unit_tests/run_all.sh (revision 0) +++ tests/unit_tests/run_all.sh (revision 8a13a85045edfcf69bf0e728d294f04b924d732c) @@ -0,0 +1,18 @@ +#!/bin/bash +########################################################################### +# +# Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. +# +# THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN +# WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. +# +# @file run_all.sh +# +# @author (last) Peter Lucia +# @date (last) 16-May-2021 +# @author (original) Peter Lucia +# @date (original) 16-May-2021 +# +############################################################################ +source ../../venv/bin/activate +for f in *.py; do python3 "$f"; done