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