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

@ -57,6 +57,8 @@ async def async_setup_entry(
class FolderSensor(SensorEntity):
"""A Syncthing folder sensor."""
_attr_should_poll = False
STATE_ATTRIBUTES = {
"errors": "errors",
"globalBytes": "global_bytes",
@ -131,11 +133,6 @@ class FolderSensor(SensorEntity):
"""Return the state attributes."""
return self._state
@property
def should_poll(self):
"""Return the polling requirement for this sensor."""
return False
@property
def device_info(self) -> DeviceInfo:
"""Return device information."""