If brightness is not available, don't set a value (#78827)

This commit is contained in:
Joakim Plate 2022-09-20 13:57:54 +02:00 committed by GitHub
parent e05ca87cc7
commit bd0daf68e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View file

@ -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