From 84d73f489b4a59f7a3c449060005ef721d412b56 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Wed, 16 Aug 2023 22:47:12 +0200 Subject: [PATCH] fix colors --- dmx_queue.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/dmx_queue.py b/dmx_queue.py index fb61c57..b3ff6ea 100644 --- a/dmx_queue.py +++ b/dmx_queue.py @@ -49,7 +49,7 @@ class DMXQueue: for idx, value in enumerate(values): 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: light.intensity = intensity light.red = red @@ -69,18 +69,20 @@ class DMXQueue: # effect duration should be between 1s and 1.5s if level == 'error': - self._update_all(0, 0, 0, 0) + self._update_all(0, 0, 0, 0, 0) sleep(0.2) # three instances of two flashes each for i in range(3): 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) - self._update_all(0, 255, 0, 0) + self._update_all(0, 255, 0, 0, 50) sleep(0.1) sleep(0.2) elif level == 'warn': - self._update_all(0, 0, 0, 0) + self._update_all(0, 0, 0, 0, 0) sleep(0.2) # warning: blink alternate, but slow for i in range(6): @@ -88,7 +90,7 @@ class DMXQueue: light.red = 255 light.green = 150 light.blue = 0 - light.white = 0 + light.white = 50 if (idx + i) % 2: light.intensity = self.config.alerts.brightness @@ -97,7 +99,7 @@ class DMXQueue: self._bulk(*light.dump()) sleep(0.2) - self._update_all(0, 0, 0, 0) + self._update_all(0, 0, 0, 0, 0) elif level == 'info': forward = list(range(15)) reverse = list(range(15)) @@ -122,6 +124,7 @@ class DMXQueue: 0, 50, 255, + 50, ) sleep(0.025) self.queue.task_done() @@ -142,6 +145,7 @@ class DMXQueue: light.red = int(r * 255) light.green = int(g * 255) light.blue = int(b * 200) + light.white = 0 light.intensity = self.config.rainbow.brightness self._bulk(*light.dump())