mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Explicitly pass in the config_entry in pvpc_hourly_pricing coordinator (#138032)
explicitly pass in the config_entry in coordinator
This commit is contained in:
parent
4a8c96471b
commit
6cebc0e25f
@ -21,6 +21,8 @@ _LOGGER = logging.getLogger(__name__)
|
|||||||
class ElecPricesDataUpdateCoordinator(DataUpdateCoordinator[EsiosApiData]):
|
class ElecPricesDataUpdateCoordinator(DataUpdateCoordinator[EsiosApiData]):
|
||||||
"""Class to manage fetching Electricity prices data from API."""
|
"""Class to manage fetching Electricity prices data from API."""
|
||||||
|
|
||||||
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, hass: HomeAssistant, entry: ConfigEntry, sensor_keys: set[str]
|
self, hass: HomeAssistant, entry: ConfigEntry, sensor_keys: set[str]
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -35,14 +37,17 @@ class ElecPricesDataUpdateCoordinator(DataUpdateCoordinator[EsiosApiData]):
|
|||||||
sensor_keys=tuple(sensor_keys),
|
sensor_keys=tuple(sensor_keys),
|
||||||
)
|
)
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass, _LOGGER, name=DOMAIN, update_interval=timedelta(minutes=30)
|
hass,
|
||||||
|
_LOGGER,
|
||||||
|
config_entry=entry,
|
||||||
|
name=DOMAIN,
|
||||||
|
update_interval=timedelta(minutes=30),
|
||||||
)
|
)
|
||||||
self._entry = entry
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def entry_id(self) -> str:
|
def entry_id(self) -> str:
|
||||||
"""Return entry ID."""
|
"""Return entry ID."""
|
||||||
return self._entry.entry_id
|
return self.config_entry.entry_id
|
||||||
|
|
||||||
async def _async_update_data(self) -> EsiosApiData:
|
async def _async_update_data(self) -> EsiosApiData:
|
||||||
"""Update electricity prices from the ESIOS API."""
|
"""Update electricity prices from the ESIOS API."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user