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:
epenet 2022-08-27 04:03:50 +02:00 committed by GitHub
parent c916fcb2c6
commit 2b9116f1f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 42 additions and 120 deletions

View file

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