From aa8f3ec8059835672c25882447405d72c8de60ee Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Tue, 8 Aug 2023 06:40:54 +0200 Subject: [PATCH] rework effects to be a bit shorter --- dmx_queue.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/dmx_queue.py b/dmx_queue.py index e9fe3ed..87a9225 100644 --- a/dmx_queue.py +++ b/dmx_queue.py @@ -66,15 +66,14 @@ class DMXQueue: level, component, text = self.queue.get_nowait() LOG.info(f'Got queue item: {level} {component} : {text}') + self._update_all(0, 0, 0, 0) + sleep(0.2) - forward = list(range(17)) - reverse = list(range(17)) - reverse.reverse() - + # effect duration should be between 1s and 1.5s if level == 'error': # three instances of two flashes each for i in range(3): - for j in range(4): + for j in range(2): self._update_all( self.config.alerts.brightness, 255, 0, 0, 50 ) @@ -97,16 +96,22 @@ class DMXQueue: light.intensity = 0 self._bulk(*light.dump()) - sleep(0.5) + sleep(0.2) self._update_all(0, 0, 0, 0) elif level == 'info': - intensity_multiplier = self.config.alerts.brightness / 17 + forward = list(range(15)) + reverse = list(range(15)) + reverse.reverse() + + # info: two times slow fade + intensity_multiplier = self.config.alerts.brightness / 15 for i in range(2): for idx in forward + reverse: self._update_all( int(intensity_multiplier * idx), 0, 50, 255 ) - sleep(0.03) + sleep(0.025) + sleep(0.2) self.queue.task_done() except Empty: if self.config.rainbow.enable: