diff --git a/dmx_queue.py b/dmx_queue.py index 66ed1cf..96659b1 100644 --- a/dmx_queue.py +++ b/dmx_queue.py @@ -31,6 +31,9 @@ class DMXQueue: self.sacn.start() self.sacn.activate_output(self.config.universe) + for light in self.lights: + self.log.info(f" LIGHT: {light}") + self.sacn[self.config.universe].multicast = self.config.multicast if not self.config.multicast: self.sacn[self.config.universe].destination = self.config.target diff --git a/lights/__init__.py b/lights/__init__.py index 85713fb..01bc925 100644 --- a/lights/__init__.py +++ b/lights/__init__.py @@ -1,3 +1,4 @@ +from .cameo_pixbar_600pro import CameoPixbar600Pro from .ignition_wal_l710 import IgnitionWALL710 from .pulsar_chromaflood_200 import PulsarChromaflood200 from .sheds_30w_cob_rgb import Sheds30WCOBRGB diff --git a/lights/cameo_pixbar_600pro.py b/lights/cameo_pixbar_600pro.py new file mode 100644 index 0000000..a629e30 --- /dev/null +++ b/lights/cameo_pixbar_600pro.py @@ -0,0 +1,61 @@ +from colorsys import hsv_to_rgb + +from .common import BaseDMXLight + + +class CameoPixbar600Pro(BaseDMXLight): + name = "Cameo Pixbar 600 Pro (78-Channel Mode)" + + def _dump(self): + return self.address, [ + self.intensity, + 0, # strobe + *[ + self.red, + self.green, + self.blue, + self.white, + 0, # amber + 0, # uv + ] + * 12, + 0, # macro + 0, # colour correction + 0, # auto mode + 0, # auto mode speed + ] + + def rainbow(self, idx, angle, number_of_lights, intensity, brightness): + degrees_per_light = 360 / number_of_lights + my_degrees_dec = (angle + (idx * degrees_per_light)) % 360 + degrees_per_pixel = degrees_per_light / 12 + + dmx_values = [ + brightness, + 0, # strobe + ] + + for pixel in range(12): + r, g, b = hsv_to_rgb( + (my_degrees_dec + (pixel * degrees_per_pixel)) / 360, + 1, + intensity / 100, + ) + + dmx_values += [ + int(r * 255), + int(g * 255), + int(b * 255), + 0, + 0, + 0, + ] + + dmx_values += [ + 0, # macro + 0, # colour correction + 0, # auto mode + 0, # auto mode speed + ] + + return self.address, dmx_values