Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly pass in the config_entry in youless coordinator init #137471

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/youless/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
except URLError as exception:
raise ConfigEntryNotReady from exception

youless_coordinator = YouLessCoordinator(hass, api)
youless_coordinator = YouLessCoordinator(hass, entry, api)
await youless_coordinator.async_config_entry_first_refresh()

hass.data.setdefault(DOMAIN, {})
Expand Down
13 changes: 11 additions & 2 deletions homeassistant/components/youless/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from youless_api import YoulessAPI

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator

Expand All @@ -14,10 +15,18 @@
class YouLessCoordinator(DataUpdateCoordinator[None]):
"""Class to manage fetching YouLess data."""

def __init__(self, hass: HomeAssistant, device: YoulessAPI) -> None:
config_entry: ConfigEntry

def __init__(
self, hass: HomeAssistant, config_entry: ConfigEntry, device: YoulessAPI
) -> None:
"""Initialize global YouLess data provider."""
super().__init__(
hass, _LOGGER, name="youless_gateway", update_interval=timedelta(seconds=10)
hass,
_LOGGER,
config_entry=config_entry,
name="youless_gateway",
update_interval=timedelta(seconds=10),
)
self.device = device

Expand Down