mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Always provide brightness value (#28228)
HA will remove attribute when light is off, but google expect all trait data all the time.
This commit is contained in:
parent
ecf2e9c0ab
commit
5fd9b474dc
@ -185,6 +185,8 @@ class BrightnessTrait(_Trait):
|
||||
brightness = self.state.attributes.get(light.ATTR_BRIGHTNESS)
|
||||
if brightness is not None:
|
||||
response["brightness"] = int(100 * (brightness / 255))
|
||||
else:
|
||||
response["brightness"] = 0
|
||||
|
||||
return response
|
||||
|
||||
|
@ -226,7 +226,7 @@ async def test_query_message(hass):
|
||||
"payload": {
|
||||
"devices": {
|
||||
"light.non_existing": {"online": False},
|
||||
"light.demo_light": {"on": False, "online": True},
|
||||
"light.demo_light": {"on": False, "online": True, "brightness": 0},
|
||||
"light.another_light": {
|
||||
"on": True,
|
||||
"online": True,
|
||||
|
Loading…
x
Reference in New Issue
Block a user