|
7 | 7 | from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME |
8 | 8 | from homeassistant.core import HomeAssistant |
9 | 9 | from homeassistant.exceptions import ConfigEntryAuthFailed |
10 | | -from homeassistant.helpers.aiohttp_client import async_create_clientsession |
11 | 10 | from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed |
12 | 11 | from omnikinverter import Device, Inverter, OmnikInverter |
13 | 12 | from omnikinverter.exceptions import OmnikInverterAuthError, OmnikInverterError |
@@ -60,20 +59,17 @@ def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None: |
60 | 59 | source_type=self.config_entry.data[CONF_SOURCE_TYPE], |
61 | 60 | username=self.config_entry.data[CONF_USERNAME], |
62 | 61 | password=self.config_entry.data[CONF_PASSWORD], |
63 | | - session=async_create_clientsession(hass), |
64 | 62 | ) |
65 | 63 | elif self.config_entry.data[CONF_SOURCE_TYPE] == "tcp": |
66 | 64 | self.omnikinverter = OmnikInverter( |
67 | 65 | host=self.config_entry.data[CONF_HOST], |
68 | 66 | source_type=self.config_entry.data[CONF_SOURCE_TYPE], |
69 | 67 | serial_number=self.config_entry.data[CONF_SERIAL], |
70 | | - session=async_create_clientsession(hass), |
71 | 68 | ) |
72 | 69 | else: |
73 | 70 | self.omnikinverter = OmnikInverter( |
74 | 71 | host=self.config_entry.data[CONF_HOST], |
75 | 72 | source_type=self.config_entry.data[CONF_SOURCE_TYPE], |
76 | | - session=async_create_clientsession(hass), |
77 | 73 | ) |
78 | 74 |
|
79 | 75 | async def _async_update_data(self) -> OmnikInverterData: |
|
0 commit comments