From 8d552ae15c32092ff74f96e6e13006a8098a6357 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 27 Aug 2020 16:59:03 +0200 Subject: [PATCH] Fix api proxy ensure_access_token for websocket (#1983) --- supervisor/homeassistant/api.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/homeassistant/api.py b/supervisor/homeassistant/api.py index 3b227e96c..aa9d35af9 100644 --- a/supervisor/homeassistant/api.py +++ b/supervisor/homeassistant/api.py @@ -26,7 +26,7 @@ class HomeAssistantAPI(CoreSysAttributes): self.access_token: Optional[str] = None self._access_token_expires: Optional[datetime] = None - async def _ensure_access_token(self) -> None: + async def ensure_access_token(self) -> None: """Ensure there is an access token.""" if ( self.access_token is not None @@ -75,7 +75,7 @@ class HomeAssistantAPI(CoreSysAttributes): headers[hdrs.CONTENT_TYPE] = content_type for _ in (1, 2): - await self._ensure_access_token() + await self.ensure_access_token() headers[hdrs.AUTHORIZATION] = f"Bearer {self.access_token}" try: