Use _attr_should_poll in components [s-t] (#77368)
* Use _attr_should_poll in components [s-t] * Adjust touchline Co-authored-by: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
c916fcb2c6
commit
2b9116f1f8
22 changed files with 42 additions and 120 deletions
|
@ -112,6 +112,8 @@ async def async_setup_platform(
|
|||
class ThresholdSensor(BinarySensorEntity):
|
||||
"""Representation of a Threshold sensor."""
|
||||
|
||||
_attr_should_poll = False
|
||||
|
||||
def __init__(
|
||||
self, hass, entity_id, name, lower, upper, hysteresis, device_class, unique_id
|
||||
):
|
||||
|
@ -168,11 +170,6 @@ class ThresholdSensor(BinarySensorEntity):
|
|||
"""Return true if sensor is on."""
|
||||
return self._state
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""No polling needed."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def device_class(self):
|
||||
"""Return the sensor class of the sensor."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue