mirror of
https://github.com/home-assistant/core.git
synced 2025-08-05 05:35:11 +02:00
Default dict if parent class returned None
This commit is contained in:
@@ -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