Skip to content

Commit 6167aa0

Browse files
Merge pull request #155 from robbinjanssen/rja/use-new-session
Do not pass session from home assistant, fails for some inverters
2 parents fb6a15a + 6cf688a commit 6167aa0

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

custom_components/omnik_inverter/coordinator.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
88
from homeassistant.core import HomeAssistant
99
from homeassistant.exceptions import ConfigEntryAuthFailed
10-
from homeassistant.helpers.aiohttp_client import async_create_clientsession
1110
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
1211
from omnikinverter import Device, Inverter, OmnikInverter
1312
from omnikinverter.exceptions import OmnikInverterAuthError, OmnikInverterError
@@ -60,20 +59,17 @@ def __init__(self, hass: HomeAssistant, entry: ConfigEntry) -> None:
6059
source_type=self.config_entry.data[CONF_SOURCE_TYPE],
6160
username=self.config_entry.data[CONF_USERNAME],
6261
password=self.config_entry.data[CONF_PASSWORD],
63-
session=async_create_clientsession(hass),
6462
)
6563
elif self.config_entry.data[CONF_SOURCE_TYPE] == "tcp":
6664
self.omnikinverter = OmnikInverter(
6765
host=self.config_entry.data[CONF_HOST],
6866
source_type=self.config_entry.data[CONF_SOURCE_TYPE],
6967
serial_number=self.config_entry.data[CONF_SERIAL],
70-
session=async_create_clientsession(hass),
7168
)
7269
else:
7370
self.omnikinverter = OmnikInverter(
7471
host=self.config_entry.data[CONF_HOST],
7572
source_type=self.config_entry.data[CONF_SOURCE_TYPE],
76-
session=async_create_clientsession(hass),
7773
)
7874

7975
async def _async_update_data(self) -> OmnikInverterData:

0 commit comments

Comments
 (0)