Use assignment expressions 18 (#57967)

This commit is contained in:
Marc Mueller 2021-10-18 18:36:35 +02:00 committed by GitHub
parent ff853b2d53
commit f149bef9f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 29 additions and 64 deletions

View file

@ -134,9 +134,7 @@ class OpenUvSensor(OpenUvEntity, SensorEntity):
@callback
def update_from_latest_data(self) -> None:
"""Update the state."""
data = self.openuv.data[DATA_UV].get("result")
if not data:
if not (data := self.openuv.data[DATA_UV].get("result")):
self._attr_available = False
return