Use _attr_should_poll in components [a-g] (#77268)
This commit is contained in:
parent
120c76524d
commit
a46c25d2c8
18 changed files with 37 additions and 95 deletions
|
@ -41,6 +41,8 @@ async def async_setup_entry(
|
|||
class GdacsSensor(SensorEntity):
|
||||
"""This is a status sensor for the GDACS integration."""
|
||||
|
||||
_attr_should_poll = False
|
||||
|
||||
def __init__(self, config_entry_id, config_unique_id, config_title, manager):
|
||||
"""Initialize entity."""
|
||||
self._config_entry_id = config_entry_id
|
||||
|
@ -79,11 +81,6 @@ class GdacsSensor(SensorEntity):
|
|||
_LOGGER.debug("Received status update for %s", self._config_entry_id)
|
||||
self.async_schedule_update_ha_state(True)
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""No polling needed for GDACS status sensor."""
|
||||
return False
|
||||
|
||||
async def async_update(self):
|
||||
"""Update this entity from the data held in the feed manager."""
|
||||
_LOGGER.debug("Updating %s", self._config_entry_id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue