From 5ab1996d3f59d9eb3d86bd5432133b405e01e71a Mon Sep 17 00:00:00 2001 From: Save me Date: Mon, 17 Jun 2019 18:33:56 +0200 Subject: [PATCH] Add sensitivity and sensitvity_max attributs for binary sensor (#24438) * Add sensitivity ans sensitvity_max attributs for binary sensor * Update binary_sensor.py * Update binary_sensor.py * Update binary_sensor.py * Update binary_sensor.py --- homeassistant/components/hue/binary_sensor.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/homeassistant/components/hue/binary_sensor.py b/homeassistant/components/hue/binary_sensor.py index b9921a9a01f..68f04058566 100644 --- a/homeassistant/components/hue/binary_sensor.py +++ b/homeassistant/components/hue/binary_sensor.py @@ -26,3 +26,14 @@ class HuePresence(GenericZLLSensor, BinarySensorDevice): def is_on(self): """Return true if the binary sensor is on.""" return self.sensor.presence + + @property + def device_state_attributes(self): + """Return the device state attributes.""" + attributes = super().device_state_attributes + if 'sensitivity' in self.sensor.config: + attributes['sensitivity'] = self.sensor.config['sensitivity'] + if 'sensitivitymax' in self.sensor.config: + attributes['sensitivity_max'] = \ + self.sensor.config['sensitivitymax'] + return attributes