mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Set config_entry explicitely in scrape coordinator (#129416)
This commit is contained in:
parent
02928601ef
commit
10fdf819d3
@ -72,7 +72,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
|
||||
scan_interval: timedelta = resource_config.get(
|
||||
CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL
|
||||
)
|
||||
coordinator = ScrapeCoordinator(hass, rest, scan_interval)
|
||||
coordinator = ScrapeCoordinator(hass, None, rest, scan_interval)
|
||||
|
||||
sensors: list[ConfigType] = resource_config.get(SENSOR_DOMAIN, [])
|
||||
if sensors:
|
||||
@ -100,6 +100,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ScrapeConfigEntry) -> bo
|
||||
|
||||
coordinator = ScrapeCoordinator(
|
||||
hass,
|
||||
entry,
|
||||
rest,
|
||||
DEFAULT_SCAN_INTERVAL,
|
||||
)
|
||||
|
@ -8,6 +8,7 @@ import logging
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
from homeassistant.components.rest import RestData
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||
|
||||
@ -18,12 +19,17 @@ class ScrapeCoordinator(DataUpdateCoordinator[BeautifulSoup]):
|
||||
"""Scrape Coordinator."""
|
||||
|
||||
def __init__(
|
||||
self, hass: HomeAssistant, rest: RestData, update_interval: timedelta
|
||||
self,
|
||||
hass: HomeAssistant,
|
||||
config_entry: ConfigEntry | None,
|
||||
rest: RestData,
|
||||
update_interval: timedelta,
|
||||
) -> None:
|
||||
"""Initialize Scrape coordinator."""
|
||||
super().__init__(
|
||||
hass,
|
||||
_LOGGER,
|
||||
config_entry=config_entry,
|
||||
name="Scrape Coordinator",
|
||||
update_interval=update_interval,
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user