1 """Handle Yale connection setup and authentication."""
4 from pathlib
import Path
6 from aiohttp
import ClientSession
7 from yalexs.authenticator_common
import Authentication, AuthenticationState
8 from yalexs.manager.gateway
import Gateway
12 _LOGGER = logging.getLogger(__name__)
16 """Handle the connection to Yale."""
21 aiohttp_session: ClientSession,
22 oauth_session: config_entry_oauth2_flow.OAuth2Session,
24 """Init the connection."""
25 super().
__init__(config_path, aiohttp_session)
29 """Get access token."""
34 """Refresh the access token if needed."""
38 """Authenticate with the details provided to setup."""
41 AuthenticationState.AUTHENTICATED,
None,
None,
None
Authentication async_authenticate(self)
None __init__(self, Path config_path, ClientSession aiohttp_session, config_entry_oauth2_flow.OAuth2Session oauth_session)
None async_refresh_access_token_if_needed(self)
str async_get_access_token(self)