예제 #1
0
    def _lid_temp_status_callback(self, lid_temp_res):
        # Payload is shaped like `T:95.0 C:77.4` where T is the
        # target temperature, C is the current temperature
        val_dict = {}
        data_substrs = [d for d in lid_temp_res.split()]

        for substr in data_substrs:
            key = utils.parse_key_from_substring(substr)
            value = utils.parse_number_from_substring(
                substr, utils.TC_GCODE_ROUNDING_PRECISION)
            val_dict[key] = value
        self._lid_temp = val_dict['C']
        self._lid_target = val_dict['T']
예제 #2
0
    def _temp_status_update_callback(self, temperature_response):
        # Payload is shaped like `T:95.0 C:77.4 H:600` where T is the
        # target temperature, C is the current temperature, and H is the
        # hold time remaining
        val_dict = {}
        data_substrs = [d for d in temperature_response.split()]

        for substr in data_substrs:
            key = utils.parse_key_from_substring(substr)
            value = utils.parse_number_from_substring(
                substr, utils.TC_GCODE_ROUNDING_PRECISION)
            val_dict[key] = value

        self._current_temp = val_dict['C']
        self._target_temp = val_dict['T']
        self._hold_time = val_dict['H']