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
|
@ -173,6 +173,8 @@ class CounterStorageCollection(collection.StorageCollection):
|
||||||
class Counter(RestoreEntity):
|
class Counter(RestoreEntity):
|
||||||
"""Representation of a counter."""
|
"""Representation of a counter."""
|
||||||
|
|
||||||
|
_attr_should_poll: bool = False
|
||||||
|
|
||||||
def __init__(self, config: dict) -> None:
|
def __init__(self, config: dict) -> None:
|
||||||
"""Initialize a counter."""
|
"""Initialize a counter."""
|
||||||
self._config: dict = config
|
self._config: dict = config
|
||||||
|
@ -187,11 +189,6 @@ class Counter(RestoreEntity):
|
||||||
counter.entity_id = ENTITY_ID_FORMAT.format(config[CONF_ID])
|
counter.entity_id = ENTITY_ID_FORMAT.format(config[CONF_ID])
|
||||||
return counter
|
return counter
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self) -> bool:
|
|
||||||
"""If entity should be polled."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self) -> str | None:
|
def name(self) -> str | None:
|
||||||
"""Return name of the counter."""
|
"""Return name of the counter."""
|
||||||
|
|
|
@ -368,6 +368,8 @@ class EDL21:
|
||||||
class EDL21Entity(SensorEntity):
|
class EDL21Entity(SensorEntity):
|
||||||
"""Entity reading values from EDL21 telegram."""
|
"""Entity reading values from EDL21 telegram."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, electricity_id, obis, name, entity_description, telegram):
|
def __init__(self, electricity_id, obis, name, entity_description, telegram):
|
||||||
"""Initialize an EDL21Entity."""
|
"""Initialize an EDL21Entity."""
|
||||||
self._electricity_id = electricity_id
|
self._electricity_id = electricity_id
|
||||||
|
@ -416,11 +418,6 @@ class EDL21Entity(SensorEntity):
|
||||||
if self._async_remove_dispatcher:
|
if self._async_remove_dispatcher:
|
||||||
self._async_remove_dispatcher()
|
self._async_remove_dispatcher()
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self) -> bool:
|
|
||||||
"""Do not poll."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self) -> str:
|
def unique_id(self) -> str:
|
||||||
"""Return a unique ID."""
|
"""Return a unique ID."""
|
||||||
|
|
|
@ -444,6 +444,7 @@ class ElkEntity(Entity):
|
||||||
"""Base class for all Elk entities."""
|
"""Base class for all Elk entities."""
|
||||||
|
|
||||||
_attr_has_entity_name = True
|
_attr_has_entity_name = True
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, element: Element, elk: Elk, elk_data: dict[str, Any]) -> None:
|
def __init__(self, element: Element, elk: Elk, elk_data: dict[str, Any]) -> None:
|
||||||
"""Initialize the base of all Elk devices."""
|
"""Initialize the base of all Elk devices."""
|
||||||
|
@ -472,11 +473,6 @@ class ElkEntity(Entity):
|
||||||
"""Return unique id of the element."""
|
"""Return unique id of the element."""
|
||||||
return self._unique_id
|
return self._unique_id
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self) -> bool:
|
|
||||||
"""Don't poll this device."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> dict[str, Any]:
|
def extra_state_attributes(self) -> dict[str, Any]:
|
||||||
"""Return the default attributes of the element."""
|
"""Return the default attributes of the element."""
|
||||||
|
|
|
@ -248,6 +248,8 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||||
class EnvisalinkDevice(Entity):
|
class EnvisalinkDevice(Entity):
|
||||||
"""Representation of an Envisalink device."""
|
"""Representation of an Envisalink device."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, name, info, controller):
|
def __init__(self, name, info, controller):
|
||||||
"""Initialize the device."""
|
"""Initialize the device."""
|
||||||
self._controller = controller
|
self._controller = controller
|
||||||
|
@ -258,8 +260,3 @@ class EnvisalinkDevice(Entity):
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the device."""
|
"""Return the name of the device."""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""No polling needed."""
|
|
||||||
return False
|
|
||||||
|
|
|
@ -675,6 +675,8 @@ ENTITY_CATEGORIES: EsphomeEnumMapper[
|
||||||
class EsphomeEntity(Entity, Generic[_InfoT, _StateT]):
|
class EsphomeEntity(Entity, Generic[_InfoT, _StateT]):
|
||||||
"""Define a base esphome entity."""
|
"""Define a base esphome entity."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
entry_data: RuntimeEntryData,
|
entry_data: RuntimeEntryData,
|
||||||
|
@ -804,11 +806,6 @@ class EsphomeEntity(Entity, Generic[_InfoT, _StateT]):
|
||||||
|
|
||||||
return cast(str, ICON_SCHEMA(self._static_info.icon))
|
return cast(str, ICON_SCHEMA(self._static_info.icon))
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self) -> bool:
|
|
||||||
"""Disable polling."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def entity_registry_enabled_default(self) -> bool:
|
def entity_registry_enabled_default(self) -> bool:
|
||||||
"""Return if the entity should be enabled when first added to the entity registry."""
|
"""Return if the entity should be enabled when first added to the entity registry."""
|
||||||
|
|
|
@ -167,6 +167,8 @@ class FFmpegManager:
|
||||||
class FFmpegBase(Entity):
|
class FFmpegBase(Entity):
|
||||||
"""Interface object for FFmpeg."""
|
"""Interface object for FFmpeg."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, initial_state=True):
|
def __init__(self, initial_state=True):
|
||||||
"""Initialize ffmpeg base object."""
|
"""Initialize ffmpeg base object."""
|
||||||
self.ffmpeg = None
|
self.ffmpeg = None
|
||||||
|
@ -201,11 +203,6 @@ class FFmpegBase(Entity):
|
||||||
"""Return True if entity is available."""
|
"""Return True if entity is available."""
|
||||||
return self.ffmpeg.is_running
|
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):
|
async def _async_start_ffmpeg(self, entity_ids):
|
||||||
"""Start a FFmpeg process.
|
"""Start a FFmpeg process.
|
||||||
|
|
||||||
|
|
|
@ -540,6 +540,8 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
class FibaroDevice(Entity):
|
class FibaroDevice(Entity):
|
||||||
"""Representation of a Fibaro device entity."""
|
"""Representation of a Fibaro device entity."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, fibaro_device):
|
def __init__(self, fibaro_device):
|
||||||
"""Initialize the device."""
|
"""Initialize the device."""
|
||||||
self.fibaro_device = fibaro_device
|
self.fibaro_device = fibaro_device
|
||||||
|
@ -634,11 +636,6 @@ class FibaroDevice(Entity):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""Get polling requirement from fibaro device."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self):
|
def extra_state_attributes(self):
|
||||||
"""Return the state attributes of the device."""
|
"""Return the state attributes of the device."""
|
||||||
|
|
|
@ -26,6 +26,8 @@ async def async_setup_entry(
|
||||||
class IncidentsSensor(RestoreEntity, SensorEntity):
|
class IncidentsSensor(RestoreEntity, SensorEntity):
|
||||||
"""Representation of FireServiceRota incidents sensor."""
|
"""Representation of FireServiceRota incidents sensor."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, client):
|
def __init__(self, client):
|
||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
self._client = client
|
self._client = client
|
||||||
|
@ -60,11 +62,6 @@ class IncidentsSensor(RestoreEntity, SensorEntity):
|
||||||
"""Return the unique ID of the sensor."""
|
"""Return the unique ID of the sensor."""
|
||||||
return self._unique_id
|
return self._unique_id
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self) -> bool:
|
|
||||||
"""No polling needed."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self) -> dict[str, Any]:
|
def extra_state_attributes(self) -> dict[str, Any]:
|
||||||
"""Return available attributes for sensor."""
|
"""Return available attributes for sensor."""
|
||||||
|
|
|
@ -27,6 +27,8 @@ async def async_setup_entry(
|
||||||
class ResponseSwitch(SwitchEntity):
|
class ResponseSwitch(SwitchEntity):
|
||||||
"""Representation of an FireServiceRota switch."""
|
"""Representation of an FireServiceRota switch."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, coordinator, client, entry):
|
def __init__(self, coordinator, client, entry):
|
||||||
"""Initialize."""
|
"""Initialize."""
|
||||||
self._coordinator = coordinator
|
self._coordinator = coordinator
|
||||||
|
@ -63,11 +65,6 @@ class ResponseSwitch(SwitchEntity):
|
||||||
"""Return the unique ID for this switch."""
|
"""Return the unique ID for this switch."""
|
||||||
return self._unique_id
|
return self._unique_id
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self) -> bool:
|
|
||||||
"""No polling needed."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
"""Return if switch is available."""
|
"""Return if switch is available."""
|
||||||
|
|
|
@ -31,6 +31,8 @@ class FirmataEntity:
|
||||||
class FirmataPinEntity(FirmataEntity):
|
class FirmataPinEntity(FirmataEntity):
|
||||||
"""Representation of a Firmata pin entity."""
|
"""Representation of a Firmata pin entity."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
api: FirmataBoardPin,
|
api: FirmataBoardPin,
|
||||||
|
@ -50,11 +52,6 @@ class FirmataPinEntity(FirmataEntity):
|
||||||
"""Get the name of the pin."""
|
"""Get the name of the pin."""
|
||||||
return self._name
|
return self._name
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self) -> bool:
|
|
||||||
"""No polling needed."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self) -> str:
|
def unique_id(self) -> str:
|
||||||
"""Return a unique identifier for this device."""
|
"""Return a unique identifier for this device."""
|
||||||
|
|
|
@ -130,6 +130,8 @@ async def update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
|
||||||
class ForkedDaapdZone(MediaPlayerEntity):
|
class ForkedDaapdZone(MediaPlayerEntity):
|
||||||
"""Representation of a forked-daapd output."""
|
"""Representation of a forked-daapd output."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, api, output, entry_id):
|
def __init__(self, api, output, entry_id):
|
||||||
"""Initialize the ForkedDaapd Zone."""
|
"""Initialize the ForkedDaapd Zone."""
|
||||||
self._api = api
|
self._api = api
|
||||||
|
@ -164,11 +166,6 @@ class ForkedDaapdZone(MediaPlayerEntity):
|
||||||
"""Return unique ID."""
|
"""Return unique ID."""
|
||||||
return f"{self._entry_id}-{self._output_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:
|
async def async_toggle(self) -> None:
|
||||||
"""Toggle the power on the zone."""
|
"""Toggle the power on the zone."""
|
||||||
if self.state == STATE_OFF:
|
if self.state == STATE_OFF:
|
||||||
|
@ -235,6 +232,8 @@ class ForkedDaapdZone(MediaPlayerEntity):
|
||||||
class ForkedDaapdMaster(MediaPlayerEntity):
|
class ForkedDaapdMaster(MediaPlayerEntity):
|
||||||
"""Representation of the main forked-daapd device."""
|
"""Representation of the main forked-daapd device."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, clientsession, api, ip_address, api_port, api_password, config_entry
|
self, clientsession, api, ip_address, api_port, api_password, config_entry
|
||||||
):
|
):
|
||||||
|
@ -412,11 +411,6 @@ class ForkedDaapdMaster(MediaPlayerEntity):
|
||||||
"""Return unique ID."""
|
"""Return unique ID."""
|
||||||
return self._config_entry.entry_id
|
return self._config_entry.entry_id
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self) -> bool:
|
|
||||||
"""Entity pushes its state to HA."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
"""Return whether the master is available."""
|
"""Return whether the master is available."""
|
||||||
|
|
|
@ -55,6 +55,8 @@ def add_entities(
|
||||||
class FreeboxDevice(ScannerEntity):
|
class FreeboxDevice(ScannerEntity):
|
||||||
"""Representation of a Freebox device."""
|
"""Representation of a Freebox device."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self, router: FreeboxRouter, device: dict[str, Any]) -> None:
|
def __init__(self, router: FreeboxRouter, device: dict[str, Any]) -> None:
|
||||||
"""Initialize a Freebox device."""
|
"""Initialize a Freebox device."""
|
||||||
self._router = router
|
self._router = router
|
||||||
|
@ -112,11 +114,6 @@ class FreeboxDevice(ScannerEntity):
|
||||||
"""Return the attributes."""
|
"""Return the attributes."""
|
||||||
return self._attrs
|
return self._attrs
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self) -> bool:
|
|
||||||
"""No polling needed."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def async_on_demand_update(self):
|
def async_on_demand_update(self):
|
||||||
"""Update state."""
|
"""Update state."""
|
||||||
|
|
|
@ -41,6 +41,8 @@ async def async_setup_entry(
|
||||||
class GdacsSensor(SensorEntity):
|
class GdacsSensor(SensorEntity):
|
||||||
"""This is a status sensor for the GDACS integration."""
|
"""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):
|
def __init__(self, config_entry_id, config_unique_id, config_title, manager):
|
||||||
"""Initialize entity."""
|
"""Initialize entity."""
|
||||||
self._config_entry_id = config_entry_id
|
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)
|
_LOGGER.debug("Received status update for %s", self._config_entry_id)
|
||||||
self.async_schedule_update_ha_state(True)
|
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):
|
async def async_update(self):
|
||||||
"""Update this entity from the data held in the feed manager."""
|
"""Update this entity from the data held in the feed manager."""
|
||||||
_LOGGER.debug("Updating %s", self._config_entry_id)
|
_LOGGER.debug("Updating %s", self._config_entry_id)
|
||||||
|
|
|
@ -112,6 +112,8 @@ async def async_setup_platform(
|
||||||
class GenericHygrostat(HumidifierEntity, RestoreEntity):
|
class GenericHygrostat(HumidifierEntity, RestoreEntity):
|
||||||
"""Representation of a Generic Hygrostat device."""
|
"""Representation of a Generic Hygrostat device."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
name,
|
name,
|
||||||
|
@ -218,11 +220,6 @@ class GenericHygrostat(HumidifierEntity, RestoreEntity):
|
||||||
return {ATTR_SAVED_HUMIDITY: self._saved_target_humidity}
|
return {ATTR_SAVED_HUMIDITY: self._saved_target_humidity}
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""Return the polling state."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the hygrostat."""
|
"""Return the name of the hygrostat."""
|
||||||
|
|
|
@ -165,6 +165,8 @@ async def async_setup_platform(
|
||||||
class GenericThermostat(ClimateEntity, RestoreEntity):
|
class GenericThermostat(ClimateEntity, RestoreEntity):
|
||||||
"""Representation of a Generic Thermostat device."""
|
"""Representation of a Generic Thermostat device."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
name,
|
name,
|
||||||
|
@ -300,11 +302,6 @@ class GenericThermostat(ClimateEntity, RestoreEntity):
|
||||||
if not self._hvac_mode:
|
if not self._hvac_mode:
|
||||||
self._hvac_mode = HVACMode.OFF
|
self._hvac_mode = HVACMode.OFF
|
||||||
|
|
||||||
@property
|
|
||||||
def should_poll(self):
|
|
||||||
"""Return the polling state."""
|
|
||||||
return False
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
"""Return the name of the thermostat."""
|
"""Return the name of the thermostat."""
|
||||||
|
|
|
@ -221,6 +221,8 @@ class GeniusBroker:
|
||||||
class GeniusEntity(Entity):
|
class GeniusEntity(Entity):
|
||||||
"""Base for all Genius Hub entities."""
|
"""Base for all Genius Hub entities."""
|
||||||
|
|
||||||
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
self._unique_id: str | None = None
|
self._unique_id: str | None = None
|
||||||
|
@ -238,11 +240,6 @@ class GeniusEntity(Entity):
|
||||||
"""Return a unique ID."""
|
"""Return a unique ID."""
|
||||||
return self._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):
|
class GeniusDevice(GeniusEntity):
|
||||||
"""Base for all Genius Hub devices."""
|
"""Base for all Genius Hub devices."""
|
||||||
|
|
|
@ -42,6 +42,8 @@ async def async_setup_entry(
|
||||||
class GeonetnzQuakesSensor(SensorEntity):
|
class GeonetnzQuakesSensor(SensorEntity):
|
||||||
"""This is a status sensor for the GeoNet NZ Quakes integration."""
|
"""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):
|
def __init__(self, config_entry_id, config_unique_id, config_title, manager):
|
||||||
"""Initialize entity."""
|
"""Initialize entity."""
|
||||||
self._config_entry_id = config_entry_id
|
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)
|
_LOGGER.debug("Received status update for %s", self._config_entry_id)
|
||||||
self.async_schedule_update_ha_state(True)
|
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):
|
async def async_update(self):
|
||||||
"""Update this entity from the data held in the feed manager."""
|
"""Update this entity from the data held in the feed manager."""
|
||||||
_LOGGER.debug("Updating %s", self._config_entry_id)
|
_LOGGER.debug("Updating %s", self._config_entry_id)
|
||||||
|
|
|
@ -61,6 +61,8 @@ async def async_setup_entry(
|
||||||
class GeonetnzVolcanoSensor(SensorEntity):
|
class GeonetnzVolcanoSensor(SensorEntity):
|
||||||
"""This represents an external event with GeoNet NZ Volcano feed data."""
|
"""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):
|
def __init__(self, config_entry_id, feed_manager, external_id, unit_system):
|
||||||
"""Initialize entity with data from feed entry."""
|
"""Initialize entity with data from feed entry."""
|
||||||
self._config_entry_id = config_entry_id
|
self._config_entry_id = config_entry_id
|
||||||
|
@ -97,11 +99,6 @@ class GeonetnzVolcanoSensor(SensorEntity):
|
||||||
"""Call update method."""
|
"""Call update method."""
|
||||||
self.async_schedule_update_ha_state(True)
|
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):
|
async def async_update(self):
|
||||||
"""Update this entity from the data held in the feed manager."""
|
"""Update this entity from the data held in the feed manager."""
|
||||||
_LOGGER.debug("Updating %s", self._external_id)
|
_LOGGER.debug("Updating %s", self._external_id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue