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 husqvarna_automower_ble coordinator #138150

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
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
model = await mower.get_model()
LOGGER.debug("Connected to Automower: %s", model)

coordinator = HusqvarnaCoordinator(hass, mower, address, channel_id, model)
coordinator = HusqvarnaCoordinator(hass, entry, mower, address, channel_id, model)

await coordinator.async_config_entry_first_refresh()
entry.runtime_data = coordinator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from bleak_retry_connector import close_stale_connections_by_address

from homeassistant.components import bluetooth
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed

Expand All @@ -20,9 +21,12 @@
class HusqvarnaCoordinator(DataUpdateCoordinator[dict[str, bytes]]):
"""Class to manage fetching data."""

config_entry: ConfigEntry

def __init__(
self,
hass: HomeAssistant,
config_entry: ConfigEntry,
mower: Mower,
address: str,
channel_id: str,
Expand All @@ -32,6 +36,7 @@ def __init__(
super().__init__(
hass=hass,
logger=LOGGER,
config_entry=config_entry,
name=DOMAIN,
update_interval=SCAN_INTERVAL,
)
Expand Down