From db31cdf075f17a338b01a2a5499a3c82df66c6ab Mon Sep 17 00:00:00 2001 From: damarco Date: Thu, 10 May 2018 21:28:57 +0200 Subject: [PATCH] Fix binary_sensor device_state_attributes (#14375) --- homeassistant/components/binary_sensor/zha.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/binary_sensor/zha.py b/homeassistant/components/binary_sensor/zha.py index be61a9e9ba4..4f3f824c8f9 100644 --- a/homeassistant/components/binary_sensor/zha.py +++ b/homeassistant/components/binary_sensor/zha.py @@ -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."""