Use assignment expressions 39 (#58829)
This commit is contained in:
parent
72801867d6
commit
e0c0d00833
23 changed files with 31 additions and 70 deletions
|
@ -260,8 +260,7 @@ class DSMREntity(SensorEntity):
|
|||
@property
|
||||
def native_value(self) -> StateType:
|
||||
"""Return the state of sensor, if available, translate if needed."""
|
||||
value = self.get_dsmr_object_attr("value")
|
||||
if value is None:
|
||||
if (value := self.get_dsmr_object_attr("value")) is None:
|
||||
return None
|
||||
|
||||
if self.entity_description.key == obis_ref.ELECTRICITY_ACTIVE_TARIFF:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue