Use assignment expressions 38 (#58828)

This commit is contained in:
Marc Mueller
2021-10-31 18:49:18 +01:00
committed by GitHub
parent b6d9e517c2
commit 72801867d6
15 changed files with 26 additions and 54 deletions

View File

@@ -59,7 +59,6 @@ class AveaLight(LightEntity):
This is the only method that should fetch new data for Home Assistant.
"""
brightness = self._light.get_brightness()
if brightness is not None:
if (brightness := self._light.get_brightness()) is not None:
self._attr_is_on = brightness != 0
self._attr_brightness = round(255 * (brightness / 4095))