mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
If brightness is not available, don't set a value (#78827)
This commit is contained in:
parent
e05ca87cc7
commit
bd0daf68e0
@ -260,8 +260,6 @@ class BrightnessTrait(_Trait):
|
||||
brightness = self.state.attributes.get(light.ATTR_BRIGHTNESS)
|
||||
if brightness is not None:
|
||||
response["brightness"] = round(100 * (brightness / 255))
|
||||
else:
|
||||
response["brightness"] = 0
|
||||
|
||||
return response
|
||||
|
||||
|
@ -383,7 +383,7 @@ async def test_query_message(hass):
|
||||
"payload": {
|
||||
"devices": {
|
||||
"light.non_existing": {"online": False},
|
||||
"light.demo_light": {"on": False, "online": True, "brightness": 0},
|
||||
"light.demo_light": {"on": False, "online": True},
|
||||
"light.another_light": {
|
||||
"on": True,
|
||||
"online": True,
|
||||
@ -727,7 +727,6 @@ async def test_execute_times_out(hass, report_state, on, brightness, value):
|
||||
"states": {
|
||||
"on": on,
|
||||
"online": True,
|
||||
"brightness": brightness,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user