Use assignment expressions 31 (#58715)
This commit is contained in:
parent
f7dea3aa1d
commit
a48ddcadd4
26 changed files with 27 additions and 58 deletions
|
@ -139,8 +139,7 @@ class EnOceanSensor(EnOceanEntity, RestoreEntity, SensorEntity):
|
|||
if self._attr_native_value is not None:
|
||||
return
|
||||
|
||||
state = await self.async_get_last_state()
|
||||
if state is not None:
|
||||
if (state := await self.async_get_last_state()) is not None:
|
||||
self._attr_native_value = state.state
|
||||
|
||||
def value_changed(self, packet):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue