- self._initialize(init_sequence)
- self._buffer = Image.new("RGB", (width, height))
- self._current_group = None
- self._last_refresh_call = 0
- self._refresh_thread = None
- if self._auto_refresh:
- self.auto_refresh = True
- self._colorconverter = ColorConverter()
-
- self._backlight_type = None
- if backlight_pin is not None:
- try:
- from pwmio import PWMOut # pylint: disable=import-outside-toplevel
-
- # 100Hz looks decent and doesn't keep the CPU too busy
- self._backlight = PWMOut(backlight_pin, frequency=100, duty_cycle=0)
- self._backlight_type = BACKLIGHT_PWM
- except ImportError:
- # PWMOut not implemented on this platform
- pass
- if self._backlight_type is None:
- self._backlight_type = BACKLIGHT_IN_OUT
- self._backlight = digitalio.DigitalInOut(backlight_pin)
- self._backlight.switch_to_output()
- self.brightness = brightness
-
- def __new__(cls, *args, **kwargs):
- from . import ( # pylint: disable=import-outside-toplevel, cyclic-import
- allocate_display,
- )
-
- allocate_display(cls)
- return super().__new__(cls)
-
- def _initialize(self, init_sequence):