Return attribute dict directly without temporary variable v2 (#41271)

This commit is contained in:
springstan authored and GitHub committed 2020-10-06 16:55:16 +02:00
1 parent 33e69fe4bf
commit 513f03eb1f
27 files changed
+90 -124

No files matched your search

+1 -2
View File
@@ -228,12 +228,11 @@ class MinMaxSensor(Entity):
@property
def device_state_attributes(self):
"""Return the state attributes of the sensor."""
state_attr = {
return {
attr: getattr(self, attr)
for attr in ATTR_TO_PROPERTY
if getattr(self, attr) is not None
}
return state_attr
@property
def icon(self):