Fix binary_sensor device_state_attributes (#14375)
This commit is contained in:
parent
f168226be9
commit
db31cdf075
1 changed files with 4 additions and 1 deletions
|
@ -219,7 +219,10 @@ class Switch(zha.Entity, BinarySensorDevice):
|
|||
@property
|
||||
def device_state_attributes(self):
|
||||
"""Return the device state attributes."""
|
||||
return {'level': self._state and self._level or 0}
|
||||
self._device_state_attributes.update({
|
||||
'level': self._state and self._level or 0
|
||||
})
|
||||
return self._device_state_attributes
|
||||
|
||||
def move_level(self, change):
|
||||
"""Increment the level, setting state if appropriate."""
|
||||
|
|
Loading…
Add table
Reference in a new issue