Skip to content
  • @FFY00:

    For instantiating a Logitech G900 for example: you define a logitech-g900.yaml:

    logitech G900:
      type: ratbag-device
      endpoints:
        - 05 00 00...
        - 05 00 00...
        - 05 00 00...
      brain:
        type: LogitechHIDPP20Brain
        parameters:
          features:
             - 0x0001
             - 0x8001
      physical:
        - RGB0:
          type: RGBLed
      actuators:
        - x:
          type: OpticalSensor
          parameters:
            default_dpi: 1000
        - y:
          type: OpticalSensor
          parameters:
            default_dpi: 1000
        - wheel:
          type: Wheel
        - b0:
          type: Button
        - b1:
          type: Button
        - b2:
          type: Button
        - b3:
          type: Button
        - b4:
          type: Button
        - b5:
          type: Button
        - b6:
          type: Button
        - b7:
          type: Button
        - b8:
          type: Button
        - b9:
          type: Button
        - b10:
          type: Button

    BasedDevice then has a class method that takes a dictionary (parsed from the YAML above) and instantiate the matching BaseDevice with all of its components.

    If you want to be fancy, you can implement an include keyword (like @whot did in https://github.com/whot/uji/blob/master/uji.py#L239-L272), so you can define a generic mouse without a brain with the common x, y, wheel and 3 buttons.

0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment