mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Default dict if parent class returned None
This commit is contained in:
parent
9a6b2c1831
commit
e7320fe969
@ -122,7 +122,7 @@ class VeraSwitch(ToggleEntity):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def state_attributes(self):
|
def state_attributes(self):
|
||||||
attr = super().state_attributes
|
attr = super().state_attributes or {}
|
||||||
|
|
||||||
if self.vera_device.has_battery:
|
if self.vera_device.has_battery:
|
||||||
attr[ATTR_BATTERY_LEVEL] = self.vera_device.battery_level + '%'
|
attr[ATTR_BATTERY_LEVEL] = self.vera_device.battery_level + '%'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user