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

@ -98,6 +98,8 @@ def _is_sun_event(sun_event):
class TodSensor(BinarySensorEntity):
"""Time of the Day Sensor."""
_attr_should_poll = False
def __init__(self, name, after, after_offset, before, before_offset, unique_id):
"""Init the ToD Sensor..."""
self._attr_unique_id = unique_id
@ -109,11 +111,6 @@ class TodSensor(BinarySensorEntity):
self._after = after
self._unsub_update: Callable[[], None] = None
@property
def should_poll(self):
"""Sensor does not need to be polled."""
return False
@property
def name(self):
"""Return the name of the sensor."""