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
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue