mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 14:27:07 +00:00
Fix binary_sensor device_state_attributes (#14375)
This commit is contained in:
parent
f168226be9
commit
db31cdf075
@ -219,7 +219,10 @@ class Switch(zha.Entity, BinarySensorDevice):
|
|||||||
@property
|
@property
|
||||||
def device_state_attributes(self):
|
def device_state_attributes(self):
|
||||||
"""Return the device state attributes."""
|
"""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):
|
def move_level(self, change):
|
||||||
"""Increment the level, setting state if appropriate."""
|
"""Increment the level, setting state if appropriate."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user