fix colors

This commit is contained in:
Franzi 2023-08-16 22:47:12 +02:00
parent d2bc9e26c0
commit 84d73f489b
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -49,7 +49,7 @@ class DMXQueue:
for idx, value in enumerate(values): for idx, value in enumerate(values):
self._dmx(start_addr + idx, value) self._dmx(start_addr + idx, value)
def _update_all(self, intensity, red, green, blue, white=50): def _update_all(self, intensity, red, green, blue, white):
for light in self.lights: for light in self.lights:
light.intensity = intensity light.intensity = intensity
light.red = red light.red = red
@ -69,18 +69,20 @@ class DMXQueue:
# effect duration should be between 1s and 1.5s # effect duration should be between 1s and 1.5s
if level == 'error': if level == 'error':
self._update_all(0, 0, 0, 0) self._update_all(0, 0, 0, 0, 0)
sleep(0.2) sleep(0.2)
# three instances of two flashes each # three instances of two flashes each
for i in range(3): for i in range(3):
for j in range(2): for j in range(2):
self._update_all(self.config.alerts.brightness, 255, 0, 0) self._update_all(
self.config.alerts.brightness, 255, 0, 0, 50
)
sleep(0.1) sleep(0.1)
self._update_all(0, 255, 0, 0) self._update_all(0, 255, 0, 0, 50)
sleep(0.1) sleep(0.1)
sleep(0.2) sleep(0.2)
elif level == 'warn': elif level == 'warn':
self._update_all(0, 0, 0, 0) self._update_all(0, 0, 0, 0, 0)
sleep(0.2) sleep(0.2)
# warning: blink alternate, but slow # warning: blink alternate, but slow
for i in range(6): for i in range(6):
@ -88,7 +90,7 @@ class DMXQueue:
light.red = 255 light.red = 255
light.green = 150 light.green = 150
light.blue = 0 light.blue = 0
light.white = 0 light.white = 50
if (idx + i) % 2: if (idx + i) % 2:
light.intensity = self.config.alerts.brightness light.intensity = self.config.alerts.brightness
@ -97,7 +99,7 @@ class DMXQueue:
self._bulk(*light.dump()) self._bulk(*light.dump())
sleep(0.2) sleep(0.2)
self._update_all(0, 0, 0, 0) self._update_all(0, 0, 0, 0, 0)
elif level == 'info': elif level == 'info':
forward = list(range(15)) forward = list(range(15))
reverse = list(range(15)) reverse = list(range(15))
@ -122,6 +124,7 @@ class DMXQueue:
0, 0,
50, 50,
255, 255,
50,
) )
sleep(0.025) sleep(0.025)
self.queue.task_done() self.queue.task_done()
@ -142,6 +145,7 @@ class DMXQueue:
light.red = int(r * 255) light.red = int(r * 255)
light.green = int(g * 255) light.green = int(g * 255)
light.blue = int(b * 200) light.blue = int(b * 200)
light.white = 0
light.intensity = self.config.rainbow.brightness light.intensity = self.config.rainbow.brightness
self._bulk(*light.dump()) self._bulk(*light.dump())