mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 00:07:10 +00:00
Fix confused brightness of xiaomi_aqara gateway light (#15314)
This commit is contained in:
parent
b65d7daed8
commit
f32098abe4
@ -31,7 +31,7 @@ class XiaomiGatewayLight(XiaomiDevice, Light):
|
|||||||
"""Initialize the XiaomiGatewayLight."""
|
"""Initialize the XiaomiGatewayLight."""
|
||||||
self._data_key = 'rgb'
|
self._data_key = 'rgb'
|
||||||
self._hs = (0, 0)
|
self._hs = (0, 0)
|
||||||
self._brightness = 180
|
self._brightness = 100
|
||||||
|
|
||||||
XiaomiDevice.__init__(self, device, name, xiaomi_hub)
|
XiaomiDevice.__init__(self, device, name, xiaomi_hub)
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ class XiaomiGatewayLight(XiaomiDevice, Light):
|
|||||||
brightness = rgba[0]
|
brightness = rgba[0]
|
||||||
rgb = rgba[1:]
|
rgb = rgba[1:]
|
||||||
|
|
||||||
self._brightness = int(255 * brightness / 100)
|
self._brightness = brightness
|
||||||
self._hs = color_util.color_RGB_to_hs(*rgb)
|
self._hs = color_util.color_RGB_to_hs(*rgb)
|
||||||
self._state = True
|
self._state = True
|
||||||
return True
|
return True
|
||||||
@ -72,7 +72,7 @@ class XiaomiGatewayLight(XiaomiDevice, Light):
|
|||||||
@property
|
@property
|
||||||
def brightness(self):
|
def brightness(self):
|
||||||
"""Return the brightness of this light between 0..255."""
|
"""Return the brightness of this light between 0..255."""
|
||||||
return self._brightness
|
return int(255 * self._brightness / 100)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def hs_color(self):
|
def hs_color(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user