diff --git a/homeassistant/components/counter/__init__.py b/homeassistant/components/counter/__init__.py index d035d658206..a16d891af54 100644 --- a/homeassistant/components/counter/__init__.py +++ b/homeassistant/components/counter/__init__.py @@ -173,6 +173,8 @@ class CounterStorageCollection(collection.StorageCollection): class Counter(RestoreEntity): """Representation of a counter.""" + _attr_should_poll: bool = False + def __init__(self, config: dict) -> None: """Initialize a counter.""" self._config: dict = config @@ -187,11 +189,6 @@ class Counter(RestoreEntity): counter.entity_id = ENTITY_ID_FORMAT.format(config[CONF_ID]) return counter - @property - def should_poll(self) -> bool: - """If entity should be polled.""" - return False - @property def name(self) -> str | None: """Return name of the counter.""" diff --git a/homeassistant/components/edl21/sensor.py b/homeassistant/components/edl21/sensor.py index fe3e52548c5..cfdbbd01a2e 100644 --- a/homeassistant/components/edl21/sensor.py +++ b/homeassistant/components/edl21/sensor.py @@ -368,6 +368,8 @@ class EDL21: class EDL21Entity(SensorEntity): """Entity reading values from EDL21 telegram.""" + _attr_should_poll = False + def __init__(self, electricity_id, obis, name, entity_description, telegram): """Initialize an EDL21Entity.""" self._electricity_id = electricity_id @@ -416,11 +418,6 @@ class EDL21Entity(SensorEntity): if self._async_remove_dispatcher: self._async_remove_dispatcher() - @property - def should_poll(self) -> bool: - """Do not poll.""" - return False - @property def unique_id(self) -> str: """Return a unique ID.""" diff --git a/homeassistant/components/elkm1/__init__.py b/homeassistant/components/elkm1/__init__.py index 2ce0e726fc4..7833bfd66b3 100644 --- a/homeassistant/components/elkm1/__init__.py +++ b/homeassistant/components/elkm1/__init__.py @@ -444,6 +444,7 @@ class ElkEntity(Entity): """Base class for all Elk entities.""" _attr_has_entity_name = True + _attr_should_poll = False def __init__(self, element: Element, elk: Elk, elk_data: dict[str, Any]) -> None: """Initialize the base of all Elk devices.""" @@ -472,11 +473,6 @@ class ElkEntity(Entity): """Return unique id of the element.""" return self._unique_id - @property - def should_poll(self) -> bool: - """Don't poll this device.""" - return False - @property def extra_state_attributes(self) -> dict[str, Any]: """Return the default attributes of the element.""" diff --git a/homeassistant/components/envisalink/__init__.py b/homeassistant/components/envisalink/__init__.py index aa276af492c..55ad58a030d 100644 --- a/homeassistant/components/envisalink/__init__.py +++ b/homeassistant/components/envisalink/__init__.py @@ -248,6 +248,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool: class EnvisalinkDevice(Entity): """Representation of an Envisalink device.""" + _attr_should_poll = False + def __init__(self, name, info, controller): """Initialize the device.""" self._controller = controller @@ -258,8 +260,3 @@ class EnvisalinkDevice(Entity): def name(self): """Return the name of the device.""" return self._name - - @property - def should_poll(self): - """No polling needed.""" - return False diff --git a/homeassistant/components/esphome/__init__.py b/homeassistant/components/esphome/__init__.py index 9df1d1af7d9..ef8808288f3 100644 --- a/homeassistant/components/esphome/__init__.py +++ b/homeassistant/components/esphome/__init__.py @@ -675,6 +675,8 @@ ENTITY_CATEGORIES: EsphomeEnumMapper[ class EsphomeEntity(Entity, Generic[_InfoT, _StateT]): """Define a base esphome entity.""" + _attr_should_poll = False + def __init__( self, entry_data: RuntimeEntryData, @@ -804,11 +806,6 @@ class EsphomeEntity(Entity, Generic[_InfoT, _StateT]): return cast(str, ICON_SCHEMA(self._static_info.icon)) - @property - def should_poll(self) -> bool: - """Disable polling.""" - return False - @property def entity_registry_enabled_default(self) -> bool: """Return if the entity should be enabled when first added to the entity registry.""" diff --git a/homeassistant/components/ffmpeg/__init__.py b/homeassistant/components/ffmpeg/__init__.py index 31650598371..a98766c78c6 100644 --- a/homeassistant/components/ffmpeg/__init__.py +++ b/homeassistant/components/ffmpeg/__init__.py @@ -167,6 +167,8 @@ class FFmpegManager: class FFmpegBase(Entity): """Interface object for FFmpeg.""" + _attr_should_poll = False + def __init__(self, initial_state=True): """Initialize ffmpeg base object.""" self.ffmpeg = None @@ -201,11 +203,6 @@ class FFmpegBase(Entity): """Return True if entity is available.""" return self.ffmpeg.is_running - @property - def should_poll(self): - """Return True if entity has to be polled for state.""" - return False - async def _async_start_ffmpeg(self, entity_ids): """Start a FFmpeg process. diff --git a/homeassistant/components/fibaro/__init__.py b/homeassistant/components/fibaro/__init__.py index ece4d38d726..7ab83d796f2 100644 --- a/homeassistant/components/fibaro/__init__.py +++ b/homeassistant/components/fibaro/__init__.py @@ -540,6 +540,8 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool: class FibaroDevice(Entity): """Representation of a Fibaro device entity.""" + _attr_should_poll = False + def __init__(self, fibaro_device): """Initialize the device.""" self.fibaro_device = fibaro_device @@ -634,11 +636,6 @@ class FibaroDevice(Entity): return True return False - @property - def should_poll(self): - """Get polling requirement from fibaro device.""" - return False - @property def extra_state_attributes(self): """Return the state attributes of the device.""" diff --git a/homeassistant/components/fireservicerota/sensor.py b/homeassistant/components/fireservicerota/sensor.py index 66878b73145..36455da9fb7 100644 --- a/homeassistant/components/fireservicerota/sensor.py +++ b/homeassistant/components/fireservicerota/sensor.py @@ -26,6 +26,8 @@ async def async_setup_entry( class IncidentsSensor(RestoreEntity, SensorEntity): """Representation of FireServiceRota incidents sensor.""" + _attr_should_poll = False + def __init__(self, client): """Initialize.""" self._client = client @@ -60,11 +62,6 @@ class IncidentsSensor(RestoreEntity, SensorEntity): """Return the unique ID of the sensor.""" return self._unique_id - @property - def should_poll(self) -> bool: - """No polling needed.""" - return False - @property def extra_state_attributes(self) -> dict[str, Any]: """Return available attributes for sensor.""" diff --git a/homeassistant/components/fireservicerota/switch.py b/homeassistant/components/fireservicerota/switch.py index 583125873d0..49c6d577b30 100644 --- a/homeassistant/components/fireservicerota/switch.py +++ b/homeassistant/components/fireservicerota/switch.py @@ -27,6 +27,8 @@ async def async_setup_entry( class ResponseSwitch(SwitchEntity): """Representation of an FireServiceRota switch.""" + _attr_should_poll = False + def __init__(self, coordinator, client, entry): """Initialize.""" self._coordinator = coordinator @@ -63,11 +65,6 @@ class ResponseSwitch(SwitchEntity): """Return the unique ID for this switch.""" return self._unique_id - @property - def should_poll(self) -> bool: - """No polling needed.""" - return False - @property def available(self) -> bool: """Return if switch is available.""" diff --git a/homeassistant/components/firmata/entity.py b/homeassistant/components/firmata/entity.py index 0e66656421b..33e23f8d401 100644 --- a/homeassistant/components/firmata/entity.py +++ b/homeassistant/components/firmata/entity.py @@ -31,6 +31,8 @@ class FirmataEntity: class FirmataPinEntity(FirmataEntity): """Representation of a Firmata pin entity.""" + _attr_should_poll = False + def __init__( self, api: FirmataBoardPin, @@ -50,11 +52,6 @@ class FirmataPinEntity(FirmataEntity): """Get the name of the pin.""" return self._name - @property - def should_poll(self) -> bool: - """No polling needed.""" - return False - @property def unique_id(self) -> str: """Return a unique identifier for this device.""" diff --git a/homeassistant/components/forked_daapd/media_player.py b/homeassistant/components/forked_daapd/media_player.py index 81a7a65cf36..6c1a772fb4d 100644 --- a/homeassistant/components/forked_daapd/media_player.py +++ b/homeassistant/components/forked_daapd/media_player.py @@ -130,6 +130,8 @@ async def update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None: class ForkedDaapdZone(MediaPlayerEntity): """Representation of a forked-daapd output.""" + _attr_should_poll = False + def __init__(self, api, output, entry_id): """Initialize the ForkedDaapd Zone.""" self._api = api @@ -164,11 +166,6 @@ class ForkedDaapdZone(MediaPlayerEntity): """Return unique ID.""" return f"{self._entry_id}-{self._output_id}" - @property - def should_poll(self) -> bool: - """Entity pushes its state to HA.""" - return False - async def async_toggle(self) -> None: """Toggle the power on the zone.""" if self.state == STATE_OFF: @@ -235,6 +232,8 @@ class ForkedDaapdZone(MediaPlayerEntity): class ForkedDaapdMaster(MediaPlayerEntity): """Representation of the main forked-daapd device.""" + _attr_should_poll = False + def __init__( self, clientsession, api, ip_address, api_port, api_password, config_entry ): @@ -412,11 +411,6 @@ class ForkedDaapdMaster(MediaPlayerEntity): """Return unique ID.""" return self._config_entry.entry_id - @property - def should_poll(self) -> bool: - """Entity pushes its state to HA.""" - return False - @property def available(self) -> bool: """Return whether the master is available.""" diff --git a/homeassistant/components/freebox/device_tracker.py b/homeassistant/components/freebox/device_tracker.py index 8b5ce4fd6e8..bd71588aea0 100644 --- a/homeassistant/components/freebox/device_tracker.py +++ b/homeassistant/components/freebox/device_tracker.py @@ -55,6 +55,8 @@ def add_entities( class FreeboxDevice(ScannerEntity): """Representation of a Freebox device.""" + _attr_should_poll = False + def __init__(self, router: FreeboxRouter, device: dict[str, Any]) -> None: """Initialize a Freebox device.""" self._router = router @@ -112,11 +114,6 @@ class FreeboxDevice(ScannerEntity): """Return the attributes.""" return self._attrs - @property - def should_poll(self) -> bool: - """No polling needed.""" - return False - @callback def async_on_demand_update(self): """Update state.""" diff --git a/homeassistant/components/gdacs/sensor.py b/homeassistant/components/gdacs/sensor.py index 0f3b19c8ef7..c5d8e76b289 100644 --- a/homeassistant/components/gdacs/sensor.py +++ b/homeassistant/components/gdacs/sensor.py @@ -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) diff --git a/homeassistant/components/generic_hygrostat/humidifier.py b/homeassistant/components/generic_hygrostat/humidifier.py index 8072c76ea07..07d2d2a36f0 100644 --- a/homeassistant/components/generic_hygrostat/humidifier.py +++ b/homeassistant/components/generic_hygrostat/humidifier.py @@ -112,6 +112,8 @@ async def async_setup_platform( class GenericHygrostat(HumidifierEntity, RestoreEntity): """Representation of a Generic Hygrostat device.""" + _attr_should_poll = False + def __init__( self, name, @@ -218,11 +220,6 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity): return {ATTR_SAVED_HUMIDITY: self._saved_target_humidity} return None - @property - def should_poll(self): - """Return the polling state.""" - return False - @property def name(self): """Return the name of the hygrostat.""" diff --git a/homeassistant/components/generic_thermostat/climate.py b/homeassistant/components/generic_thermostat/climate.py index 9e6df475d39..c2eecf413f7 100644 --- a/homeassistant/components/generic_thermostat/climate.py +++ b/homeassistant/components/generic_thermostat/climate.py @@ -165,6 +165,8 @@ async def async_setup_platform( class GenericThermostat(ClimateEntity, RestoreEntity): """Representation of a Generic Thermostat device.""" + _attr_should_poll = False + def __init__( self, name, @@ -300,11 +302,6 @@ class GenericThermostat(ClimateEntity, RestoreEntity): if not self._hvac_mode: self._hvac_mode = HVACMode.OFF - @property - def should_poll(self): - """Return the polling state.""" - return False - @property def name(self): """Return the name of the thermostat.""" diff --git a/homeassistant/components/geniushub/__init__.py b/homeassistant/components/geniushub/__init__.py index 3c5cc22af81..fc04f314812 100644 --- a/homeassistant/components/geniushub/__init__.py +++ b/homeassistant/components/geniushub/__init__.py @@ -221,6 +221,8 @@ class GeniusBroker: class GeniusEntity(Entity): """Base for all Genius Hub entities.""" + _attr_should_poll = False + def __init__(self) -> None: """Initialize the entity.""" self._unique_id: str | None = None @@ -238,11 +240,6 @@ class GeniusEntity(Entity): """Return a unique ID.""" return self._unique_id - @property - def should_poll(self) -> bool: - """Return False as geniushub entities should not be polled.""" - return False - class GeniusDevice(GeniusEntity): """Base for all Genius Hub devices.""" diff --git a/homeassistant/components/geonetnz_quakes/sensor.py b/homeassistant/components/geonetnz_quakes/sensor.py index bd99eb5a59f..357c86a3b8f 100644 --- a/homeassistant/components/geonetnz_quakes/sensor.py +++ b/homeassistant/components/geonetnz_quakes/sensor.py @@ -42,6 +42,8 @@ async def async_setup_entry( class GeonetnzQuakesSensor(SensorEntity): """This is a status sensor for the GeoNet NZ Quakes 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 @@ -80,11 +82,6 @@ class GeonetnzQuakesSensor(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 GeoNet NZ Quakes 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) diff --git a/homeassistant/components/geonetnz_volcano/sensor.py b/homeassistant/components/geonetnz_volcano/sensor.py index a1d012d8d41..e11a9394579 100644 --- a/homeassistant/components/geonetnz_volcano/sensor.py +++ b/homeassistant/components/geonetnz_volcano/sensor.py @@ -61,6 +61,8 @@ async def async_setup_entry( class GeonetnzVolcanoSensor(SensorEntity): """This represents an external event with GeoNet NZ Volcano feed data.""" + _attr_should_poll = False + def __init__(self, config_entry_id, feed_manager, external_id, unit_system): """Initialize entity with data from feed entry.""" self._config_entry_id = config_entry_id @@ -97,11 +99,6 @@ class GeonetnzVolcanoSensor(SensorEntity): """Call update method.""" self.async_schedule_update_ha_state(True) - @property - def should_poll(self): - """No polling needed for GeoNet NZ Volcano feed location events.""" - return False - async def async_update(self): """Update this entity from the data held in the feed manager.""" _LOGGER.debug("Updating %s", self._external_id)