diff options
author | lonkaars <loek@pipeframe.xyz> | 2021-08-13 15:12:32 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2021-08-13 15:12:32 +0200 |
commit | 2c510147c412cbd5596045ee666cd8f416954d64 (patch) | |
tree | 2ffa4c49781245487c8dd5149128d5546cbe086d /light.py | |
parent | f1872e3b036e679d8e6b5f8e08c31da18caaa37a (diff) |
global brightness
Diffstat (limited to 'light.py')
-rw-r--r-- | light.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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)) |