Skip to content

Commit 0a480a2

Browse files
authored
Remove import of config_entry_oauth2_flow in scaffold in favor of direct imports (home-assistant#156302)
1 parent d5da64d commit 0a480a2

File tree

1 file changed

+5
-7
lines changed
  • script/scaffold/templates/config_flow_oauth2/integration

1 file changed

+5
-7
lines changed

script/scaffold/templates/config_flow_oauth2/integration/__init__.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
from homeassistant.const import Platform
77
from homeassistant.core import HomeAssistant
88
from homeassistant.exceptions import ConfigEntryNotReady
9-
from homeassistant.helpers import aiohttp_client, config_entry_oauth2_flow
9+
from homeassistant.helpers import aiohttp_client
1010
from homeassistant.helpers.config_entry_oauth2_flow import (
1111
ImplementationUnavailableError,
12+
OAuth2Session,
13+
async_get_config_entry_implementation,
1214
)
1315

1416
from . import api
@@ -26,17 +28,13 @@
2628
async def async_setup_entry(hass: HomeAssistant, entry: New_NameConfigEntry) -> bool:
2729
"""Set up NEW_NAME from a config entry."""
2830
try:
29-
implementation = (
30-
await config_entry_oauth2_flow.async_get_config_entry_implementation(
31-
hass, entry
32-
)
33-
)
31+
implementation = await async_get_config_entry_implementation(hass, entry)
3432
except ImplementationUnavailableError as err:
3533
raise ConfigEntryNotReady(
3634
"OAuth2 implementation temporarily unavailable, will retry"
3735
) from err
3836

39-
session = config_entry_oauth2_flow.OAuth2Session(hass, entry, implementation)
37+
session = OAuth2Session(hass, entry, implementation)
4038

4139
# If using a requests-based API lib
4240
entry.runtime_data = api.ConfigEntryAuth(hass, session)

0 commit comments

Comments
 (0)