If brightness is not available, don't set a value (#78827)
This commit is contained in:
parent
e05ca87cc7
commit
bd0daf68e0
2 changed files with 1 additions and 4 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue