Skip to content

Commit 5696f8b

Browse files
committed
Update api.py
Mypy fixing
1 parent 57bf307 commit 5696f8b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pyhilo/api.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from aiohttp import ClientSession
1313
from aiohttp.client_exceptions import ClientResponseError
1414
import backoff
15+
from homeassistant.helpers.config_entry_oauth2_flow import OAuth2Session
1516

1617
from pyhilo.const import (
1718
ANDROID_CLIENT_ENDPOINT,
@@ -66,7 +67,7 @@ def __init__(
6667
self,
6768
*,
6869
session: ClientSession,
69-
oauth_session,
70+
oauth_session: OAuth2Session,
7071
request_retries: int = REQUEST_RETRY,
7172
log_traces: bool = False,
7273
) -> None:
@@ -97,7 +98,7 @@ async def async_create(
9798
cls,
9899
*,
99100
session: ClientSession,
100-
oauth_session,
101+
oauth_session: OAuth2Session,
101102
request_retries: int = REQUEST_RETRY,
102103
log_traces: bool = False,
103104
) -> API:
@@ -140,7 +141,7 @@ async def async_get_access_token(self) -> str:
140141
await self._oauth_session.async_ensure_token_valid()
141142

142143
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)
144145

145146
return str(self._oauth_session.token["access_token"])
146147

@@ -382,11 +383,12 @@ async def _async_post_init(self) -> None:
382383
# Create both websocket clients
383384
# ic-dev21 need to work on this as it can't lint as is, may need to
384385
# 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
386388

387389
# For backward compatibility during the transition to challengehub websocket
388390
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
390392

391393
async def refresh_ws_token(self) -> None:
392394
"""Refresh the websocket token."""

0 commit comments

Comments
 (0)