1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2025-12-24 20:35:55 +00:00

Force auto API password (#1065)

This commit is contained in:
Pascal Vizeli
2019-04-29 11:43:13 +02:00
committed by GitHub
parent a234006de2
commit 6970cebf80
2 changed files with 2 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ class APIHomeAssistant(CoreSysAttributes):
if ATTR_REFRESH_TOKEN in body:
self.sys_homeassistant.refresh_token = body[ATTR_REFRESH_TOKEN]
self.sys_homeassistant.api_password = None
self.sys_homeassistant.save_data()

View File

@@ -463,7 +463,7 @@ class HomeAssistant(JsonConfig, CoreSysAttributes):
headers[hdrs.CONTENT_TYPE] = content_type
# Set old API Password
if self.api_password:
if not self.refresh_token and self.api_password:
headers[HEADER_HA_ACCESS] = self.api_password
for _ in (1, 2):