File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
homeassistant/components/nest Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -50,13 +50,14 @@ async def async_get_access_token(self) -> str:
50
50
return cast (str , self ._oauth_session .token ["access_token" ])
51
51
52
52
async def async_get_creds (self ) -> Credentials :
53
- """Return an OAuth credential for Pub/Sub Subscriber."""
54
- # We don't have a way for Home Assistant to refresh creds on behalf
55
- # of the google pub/sub subscriber. Instead, build a full
56
- # Credentials object with enough information for the subscriber to
57
- # handle this on its own. We purposely don't refresh the token here
58
- # even when it is expired to fully hand off this responsibility and
59
- # know it is working at startup (then if not, fail loudly).
53
+ """Return an OAuth credential for Pub/Sub Subscriber.
54
+
55
+ The subscriber will call this when connecting to the stream to refresh
56
+ the token. We construct a credentials object using the underlying
57
+ OAuth2Session since the subscriber may expect the expiry fields to
58
+ be present.
59
+ """
60
+ await self .async_get_access_token ()
60
61
token = self ._oauth_session .token
61
62
creds = Credentials ( # type: ignore[no-untyped-call]
62
63
token = token ["access_token" ],
You can’t perform that action at this time.
0 commit comments