make info less annoying

This commit is contained in:
Franzi 2023-08-13 23:28:14 +02:00
parent aa8f3ec805
commit 267bca1f86
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -66,11 +66,11 @@ class DMXQueue:
level, component, text = self.queue.get_nowait() level, component, text = self.queue.get_nowait()
LOG.info(f'Got queue item: {level} {component} : {text}') LOG.info(f'Got queue item: {level} {component} : {text}')
self._update_all(0, 0, 0, 0)
sleep(0.2)
# 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)
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):
@ -82,6 +82,8 @@ class DMXQueue:
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)
sleep(0.2)
# warning: blink alternate, but slow # warning: blink alternate, but slow
for i in range(6): for i in range(6):
for idx, light in enumerate(self.lights): for idx, light in enumerate(self.lights):
@ -103,15 +105,27 @@ class DMXQueue:
reverse = list(range(15)) reverse = list(range(15))
reverse.reverse() reverse.reverse()
# info: two times slow fade if self.config.rainbow.enable:
intensity_multiplier = self.config.alerts.brightness / 15 diff = (
for i in range(2): self.config.alerts.brightness
- self.config.rainbow.brightness
)
LOG.debug(diff)
if diff >= 50:
for idx in forward + reverse: for idx in forward + reverse:
LOG.debug(idx)
LOG.debug(diff * idx)
self._update_all( self._update_all(
int(intensity_multiplier * idx), 0, 50, 255 int(
self.config.rainbow.brightness
+ ((diff / len(forward + reverse)) * idx)
),
0,
50,
255,
) )
sleep(0.025) sleep(0.025)
sleep(0.2)
self.queue.task_done() self.queue.task_done()
except Empty: except Empty:
if self.config.rainbow.enable: if self.config.rainbow.enable: