Use _attr_should_poll in components [a-g] (#77268)

This commit is contained in:
epenet 2022-08-26 10:15:33 +02:00 committed by GitHub
parent 120c76524d
commit a46c25d2c8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 37 additions and 95 deletions

View file

@ -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)