Pass session to forecast constructor (#55075)
This commit is contained in:
parent
68f1c19049
commit
21806115ee
1 changed files with 3 additions and 0 deletions
|
@ -11,6 +11,7 @@ from homeassistant.components import websocket_api
|
|||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
|
||||
from .const import (
|
||||
|
@ -32,8 +33,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
if not api_key:
|
||||
api_key = None
|
||||
|
||||
session = async_get_clientsession(hass)
|
||||
forecast = ForecastSolar(
|
||||
api_key=api_key,
|
||||
session=session,
|
||||
latitude=entry.data[CONF_LATITUDE],
|
||||
longitude=entry.data[CONF_LONGITUDE],
|
||||
declination=entry.options[CONF_DECLINATION],
|
||||
|
|
Loading…
Add table
Reference in a new issue