Trellis

Adafruit trellis related modules.

Driver for Trellis devices.

class mauzr.hardware.trellis.driver.Driver(core, cfgbase='trellis', **kwargs)

Bases: mauzr.hardware.driver.PollingDriver

Driver for trellis devices.

Parameters:
  • core (object) – Core instance.
  • cfgbase (str) – Configuration entry for this unit.
  • kwargs (dict) – Keyword arguments that will be merged into the config.

Required core units:

  • mqtt
  • i2c

Configuration:

  • base (str) - Base to use for topics.
  • address (int) - I2C address of the device.
  • interval (int) - Button poll intervall in milliseconds.
  • brightness (int) - Brightness of all active LEDs, 0-15.

Input topics:

  • /leds (bytes) - Preformated LED data.

Output topics:

  • /buttons (bytes) - Button readout from the chip.

Controller for Trellis devices.

class mauzr.hardware.trellis.controller.Controller(core, cfgbase='trellis', **kwargs)

Bases: object

Driver for trellis devices.

Parameters:
  • core (object) – Core instance.
  • cfgbase (str) – Configuration entry for this unit.
  • kwargs (dict) – Keyword arguments that will be merged into the config.

Required core units:

  • mqtt

Configuration:

  • base (str) - Topic base.
  • button_topics (tuple) - List of topics to map button presses to.
  • led_topics (tuple) - List of topics to receive led settings by.

Input topics:

  • /buttons - Button readout from the chip.
  • [ led_topics ] (?) - Topics to be bound to the LEDs.

Output topics:

  • leds: Preformated LED data.
  • [ button_topics ] (?) - Topics to be bound to the buttons.
BUTTON_LUT = [7, 4, 2, 34, 5, 6, 0, 1, 3, 16, 48, 33, 19, 18, 17, 49]
LED_LUT = [58, 55, 53, 52, 40, 41, 35, 36, 22, 27, 17, 16, 14, 13, 12, 2]