Skip to content

Commit

Permalink
fix hass warning (homeassistant.helpers.aiohttp_client)
Browse files Browse the repository at this point in the history
  • Loading branch information
marq24 committed Jun 21, 2024
1 parent ab09c73 commit 66b048f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions custom_components/tibber_local/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
import logging

import voluptuous as vol

from custom_components.tibber_local import TibberLocalBridge
from requests.exceptions import HTTPError, Timeout
from aiohttp import ClientResponseError

from homeassistant import config_entries
from homeassistant.const import CONF_ID, CONF_HOST, CONF_NAME, CONF_SCAN_INTERVAL, CONF_PASSWORD, CONF_MODE
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from requests.exceptions import HTTPError, Timeout

from custom_components.tibber_local import TibberLocalBridge
from .const import (
DOMAIN,
DEFAULT_NAME,
Expand Down Expand Up @@ -53,9 +52,9 @@ def __init__(self):

async def _test_connection_tibber_local(self, host, pwd, node_num):
self._errors = {}
websession = self.hass.helpers.aiohttp_client.async_get_clientsession()
try:
bridge = TibberLocalBridge(host=host, pwd=pwd, websession=websession, node_num=node_num)
bridge = TibberLocalBridge(host=host, pwd=pwd, websession=async_get_clientsession(self.hass),
node_num=node_num)
await bridge.detect_com_mode()
if bridge._com_mode in ENUM_IMPLEMENTATIONS:
self._con_mode = bridge._com_mode
Expand Down

0 comments on commit 66b048f

Please sign in to comment.