aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--light.py8
1 files 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))