Increase static type coverage for nest integration (#53475)

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Allen Porter 2021-07-26 16:43:52 -07:00 committed by GitHub
parent d4c4263730
commit 6376b4be5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 146 additions and 110 deletions

View file

@ -29,13 +29,13 @@ class AsyncConfigEntryAuth(AbstractAuth):
self._client_id = client_id
self._client_secret = client_secret
async def async_get_access_token(self):
async def async_get_access_token(self) -> str:
"""Return a valid access token for SDM API."""
if not self._oauth_session.valid_token:
await self._oauth_session.async_ensure_token_valid()
return self._oauth_session.token["access_token"]
async def async_get_creds(self):
async def async_get_creds(self) -> Credentials:
"""Return an OAuth credential for Pub/Sub Subscriber."""
# We don't have a way for Home Assistant to refresh creds on behalf
# of the google pub/sub subscriber. Instead, build a full