mirror of
https://github.com/home-assistant/core.git
synced 2025-11-15 22:10:09 +00:00
Use assignment expressions 38 (#58828)
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user