Fix binary_sensor device_state_attributes (#14375)

This commit is contained in:
damarco 2018-05-10 21:28:57 +02:00 committed by Pascal Vizeli
parent f168226be9
commit db31cdf075

View file

@ -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."""