def auto_max(self, new_max): """Set the auto max of the node to new_max.""" # verify that new_max is a valid input new_max_i = int(new_max) verify_value_in_range(new_max_i, DUCO_PCT_RANGE_START, DUCO_PCT_RANGE_STEP, DUCO_PCT_RANGE_STOP) # valid, safe to assign self._reg_automax.value = new_max_i
def button3(self, new_setpoint): """Set the setpoint of button 3.""" # verify that new_setpoint is a valid input new_setpoint_i = int(new_setpoint) verify_value_in_range(new_setpoint_i, DUCO_PCT_RANGE_START, DUCO_PCT_RANGE_STEP, DUCO_PCT_RANGE_STOP) # valid, safe to assign self._reg_button_3.value = new_setpoint_i
def action(self, new_action): """Set node.action to new_action.""" # verify that new_action is a valid input new_action_i = int(new_action) # if a ZoneAction enum was passed, we need to correct the int value if isinstance(new_action, ZoneAction): new_action_i = new_action_i - DUCO_ACTION_OFFSET # verify that converted value is in int range verify_value_in_range(new_action_i, 0, 1, 6) # valid, safe to assign self._reg_action.value = new_action_i