def get_ambient_light_sensor_value(self) -> float: response = self.request( command_id=SensorCommand.get_ambient_light_sensor_value, target_id=0x12, ) return float_from_bytes(response.data)
def callback_wrapper(response: Packet): callback_data = {} for i, data in enumerate(grouper(response.data, 4, fillvalue=0x00)): value: float = float_from_bytes(data) parameter: Enum = parameters[i] if parameter.value.modifier: value = parameter.value.modifier(value) callback_data[parameter] = value return callback(callback_data)
def get_leg_position(self) -> float: response = self.request( AnimatronicsCommand.get_leg_position, target_id=0x12, ) return float_from_bytes(response.data)