Skip to content

Commit

Permalink
feat: Update hass.helpers usage before
Browse files Browse the repository at this point in the history
Home Assistant 2024.11
  • Loading branch information
jcgoette committed Sep 24, 2024
1 parent 75c263a commit 6e621f0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion custom_components/babybuddy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.device_registry import (
DeviceRegistry,
async_entries_for_config_entry,
Expand Down Expand Up @@ -128,7 +129,7 @@ def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
config_entry.data[CONF_PORT],
config_entry.data[CONF_PATH],
config_entry.data[CONF_API_KEY],
hass.helpers.aiohttp_client.async_get_clientsession(),
async_get_clientsession(self.hass),
)
self.device_registry: DeviceRegistry = async_get(self.hass)
self.child_ids: list[str] = []
Expand Down
5 changes: 3 additions & 2 deletions custom_components/babybuddy/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
)
from homeassistant.core import callback
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers.aiohttp_client import async_get_clientsession

from .client import BabyBuddyClient
from .const import (
Expand Down Expand Up @@ -78,7 +79,7 @@ async def async_step_user(
user_input[CONF_PORT],
user_input[CONF_PATH],
user_input[CONF_API_KEY],
self.hass.helpers.aiohttp_client.async_get_clientsession(),
async_get_clientsession(self.hass),
)
await client.async_connect()
except AuthorizationError:
Expand Down Expand Up @@ -120,7 +121,7 @@ async def async_step_reauth_confirm(
user_input[CONF_PORT],
user_input[CONF_PATH],
user_input[CONF_API_KEY],
self.hass.helpers.aiohttp_client.async_get_clientsession(),
async_get_clientsession(self.hass),
)
await client.async_connect()
except ConnectError:
Expand Down

0 comments on commit 6e621f0

Please sign in to comment.