Use assignment expressions 06 (#57786)
This commit is contained in:
parent
d5116810d4
commit
2a8eaf0e0f
21 changed files with 35 additions and 69 deletions
|
@ -56,8 +56,7 @@ class SpeedtestSensor(RestoreEntity, SensorEntity):
|
|||
|
||||
def update(self) -> None:
|
||||
"""Get the latest data and update the states."""
|
||||
data = self._speedtest_data.data # type: ignore[attr-defined]
|
||||
if data is None:
|
||||
if (data := self._speedtest_data.data) is None: # type: ignore[attr-defined]
|
||||
return
|
||||
self._attr_native_value = data["download"]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue