mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 01:08:12 +00:00
Removing unused API file form weheat (#135518)
This commit is contained in:
parent
1e4c7e832d
commit
1fa3d90d73
@ -1,28 +0,0 @@
|
||||
"""API for Weheat bound to Home Assistant OAuth."""
|
||||
|
||||
from aiohttp import ClientSession
|
||||
from weheat.abstractions import AbstractAuth
|
||||
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN
|
||||
from homeassistant.helpers.config_entry_oauth2_flow import OAuth2Session
|
||||
|
||||
from .const import API_URL
|
||||
|
||||
|
||||
class AsyncConfigEntryAuth(AbstractAuth):
|
||||
"""Provide Weheat authentication tied to an OAuth2 based config entry."""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
websession: ClientSession,
|
||||
oauth_session: OAuth2Session,
|
||||
) -> None:
|
||||
"""Initialize Weheat auth."""
|
||||
super().__init__(websession, host=API_URL)
|
||||
self._oauth_session = oauth_session
|
||||
|
||||
async def async_get_access_token(self) -> str:
|
||||
"""Return a valid access token."""
|
||||
await self._oauth_session.async_ensure_token_valid()
|
||||
|
||||
return self._oauth_session.token[CONF_ACCESS_TOKEN]
|
Loading…
x
Reference in New Issue
Block a user