Default dict if parent class returned None
This commit is contained in:
1 parent
9a6b2c1831
commit
e7320fe969
1 file changed
+1
-1
@@ -122,7 +122,7 @@ class VeraSwitch(ToggleEntity):
|
||||
|
||||
@property
|
||||
def state_attributes(self):
|
||||
attr = super().state_attributes
|
||||
attr = super().state_attributes or {}
|
||||
|
||||
if self.vera_device.has_battery:
|
||||
attr[ATTR_BATTERY_LEVEL] = self.vera_device.battery_level + '%'
|
||||
|
||||
Reference in new issue
Block a user