Default dict if parent class returned None

This commit is contained in:
pavoni 2015-09-27 17:06:49 +01:00
parent 9a6b2c1831
commit e7320fe969

View File

@ -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 + '%'