viri-leds-dmx-sacn/lights/common.py

24 lines
487 B
Python
Raw Normal View History

2023-08-07 11:39:15 +00:00
import logging
LOG = logging.getLogger('DMX')
class BaseDMXLight:
def __init__(self, address):
self.address = address
self.intensity = 0
self.red = 0
self.green = 0
self.blue = 0
self.white = 0
def __str__(self):
return f'{self.name} ({self.address})'
def _dump(self):
raise NotImplementedError
def dump(self):
ret = self._dump()
LOG.info(f'{str(self)} -> {ret[1]}')
return ret