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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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):