Use assignment expressions 34 (#58823)
This commit is contained in:
parent
e0c0d00833
commit
4c68662612
30 changed files with 36 additions and 75 deletions
|
@ -282,8 +282,7 @@ class HomematicipIlluminanceSensor(HomematicipGenericEntity, SensorEntity):
|
|||
state_attr = super().extra_state_attributes
|
||||
|
||||
for attr, attr_key in ILLUMINATION_DEVICE_ATTRIBUTES.items():
|
||||
attr_value = getattr(self._device, attr, None)
|
||||
if attr_value:
|
||||
if attr_value := getattr(self._device, attr, None):
|
||||
state_attr[attr_key] = attr_value
|
||||
|
||||
return state_attr
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue