From 2c510147c412cbd5596045ee666cd8f416954d64 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 13 Aug 2021 15:12:32 +0200 Subject: global brightness --- light.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/light.py b/light.py index f7cb243..e719d85 100644 --- a/light.py +++ b/light.py @@ -90,9 +90,9 @@ class BekenLight(LightEntity): self.update_beken_lamp() def update_beken_lamp(self): - r = int(self._on) * self._rgb[0] - g = int(self._on) * self._rgb[1] - b = int(self._on) * self._rgb[2] - l = int(self._on) * self._w + r = int( int(self._on) * self._rgb[0] * ( self._brightness / 255 ) ) + g = int( int(self._on) * self._rgb[1] * ( self._brightness / 255 ) ) + b = int( int(self._on) * self._rgb[2] * ( self._brightness / 255 ) ) + l = int( int(self._on) * self._w * ( self._brightness / 255 ) ) self._connection.send(BEKEN_CHARACTERISTIC_LAMP, makemsg(r, g, b, l)) -- cgit v1.2.3