1 """API for iotty bound to Home Assistant OAuth."""
3 from __future__
import annotations
7 from aiohttp
import ClientSession
8 from iottycloud.cloudapi
import CloudApi
13 OAUTH2_CLIENT_ID =
"hass-iotty"
14 IOTTYAPI_BASE =
"https://homeassistant.iotty.com/"
18 """Provide iotty authentication tied to an OAuth2 based config entry."""
23 websession: ClientSession,
24 oauth_session: config_entry_oauth2_flow.OAuth2Session,
26 """Initialize iotty auth."""
28 super().
__init__(websession, IOTTYAPI_BASE, OAUTH2_CLIENT_ID)
29 if oauth_session
is None:
30 raise ValueError(
"oauth_session")
35 """Return a valid access token."""
None __init__(self, HomeAssistant hass, ClientSession websession, config_entry_oauth2_flow.OAuth2Session oauth_session)
Any async_get_access_token(self)