Ejemplo n.º 1
0
    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)
Ejemplo n.º 2
0
        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)
Ejemplo n.º 3
0
 def get_leg_position(self) -> float:
     response = self.request(
         AnimatronicsCommand.get_leg_position,
         target_id=0x12,
     )
     return float_from_bytes(response.data)