|
12 | 12 | from aiohttp import ClientSession |
13 | 13 | from aiohttp.client_exceptions import ClientResponseError |
14 | 14 | import backoff |
| 15 | +from homeassistant.helpers.config_entry_oauth2_flow import OAuth2Session |
15 | 16 |
|
16 | 17 | from pyhilo.const import ( |
17 | 18 | ANDROID_CLIENT_ENDPOINT, |
@@ -66,7 +67,7 @@ def __init__( |
66 | 67 | self, |
67 | 68 | *, |
68 | 69 | session: ClientSession, |
69 | | - oauth_session, |
| 70 | + oauth_session: OAuth2Session, |
70 | 71 | request_retries: int = REQUEST_RETRY, |
71 | 72 | log_traces: bool = False, |
72 | 73 | ) -> None: |
@@ -97,7 +98,7 @@ async def async_create( |
97 | 98 | cls, |
98 | 99 | *, |
99 | 100 | session: ClientSession, |
100 | | - oauth_session, |
| 101 | + oauth_session: OAuth2Session, |
101 | 102 | request_retries: int = REQUEST_RETRY, |
102 | 103 | log_traces: bool = False, |
103 | 104 | ) -> API: |
@@ -140,7 +141,7 @@ async def async_get_access_token(self) -> str: |
140 | 141 | await self._oauth_session.async_ensure_token_valid() |
141 | 142 |
|
142 | 143 | access_token = str(self._oauth_session.token["access_token"]) |
143 | | - LOG.debug("Websocket access token is %s", access_token) |
| 144 | + LOG.debug("LOCALLY Websocket access token is %s", access_token) |
144 | 145 |
|
145 | 146 | return str(self._oauth_session.token["access_token"]) |
146 | 147 |
|
@@ -382,11 +383,12 @@ async def _async_post_init(self) -> None: |
382 | 383 | # Create both websocket clients |
383 | 384 | # ic-dev21 need to work on this as it can't lint as is, may need to |
384 | 385 | # instantiate differently |
385 | | - self.websocket_devices = WebsocketClient(self.websocket_manager.devicehub) |
| 386 | + # TODO: fix type ignore after refactor |
| 387 | + self.websocket_devices = WebsocketClient(self.websocket_manager.devicehub) # type: ignore |
386 | 388 |
|
387 | 389 | # For backward compatibility during the transition to challengehub websocket |
388 | 390 | self.websocket = self.websocket_devices |
389 | | - self.websocket_challenges = WebsocketClient(self.websocket_manager.challengehub) |
| 391 | + self.websocket_challenges = WebsocketClient(self.websocket_manager.challengehub) # type: ignore |
390 | 392 |
|
391 | 393 | async def refresh_ws_token(self) -> None: |
392 | 394 | """Refresh the websocket token.""" |
|
0 commit comments