Use assignment expressions 06 (#57786)
This commit is contained in:
parent
d5116810d4
commit
2a8eaf0e0f
21 changed files with 35 additions and 69 deletions
|
@ -218,8 +218,7 @@ class FidoSensor(SensorEntity):
|
|||
async def async_update(self):
|
||||
"""Get the latest data from Fido and update the state."""
|
||||
await self.fido_data.async_update()
|
||||
sensor_type = self.entity_description.key
|
||||
if sensor_type == "balance":
|
||||
if (sensor_type := self.entity_description.key) == "balance":
|
||||
if self.fido_data.data.get(sensor_type) is not None:
|
||||
self._attr_native_value = round(self.fido_data.data[sensor_type], 2)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue