mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
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
This commit is contained in:
parent
ffce593cc8
commit
5ab1996d3f
@ -26,3 +26,14 @@ class HuePresence(GenericZLLSensor, BinarySensorDevice):
|
|||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""Return true if the binary sensor is on."""
|
"""Return true if the binary sensor is on."""
|
||||||
return self.sensor.presence
|
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user