Update to georideapilib 0.2.0

This commit is contained in:
2019-10-27 02:05:39 +02:00
parent f13daa3322
commit d027e858ce
2 changed files with 6 additions and 4 deletions

View File

@@ -56,10 +56,12 @@ async def async_setup_entry(hass, entry):
"""Set up Georide entry."""
config = hass.data[DOMAIN]["config"]
email = config.get(CONF_EMAIL) or entry.data[CONF_EMAIL]
password = config.get(CONF_EMAIL) or entry.data[CONF_EMAIL]
password = config.get(CONF_PASSWORD) or entry.data[CONF_PASSWORD]
if email is None or password is None:
return False
account = GeorideApi.get_authorisation_token(email, password)
context = GeorideContext(
hass,
email,
@@ -68,7 +70,7 @@ async def async_setup_entry(hass, entry):
)
entry["description_placeholders"] = {
"auth_token": account.auth_token
"auth_token": account.auth_token or "null"
}
hass.data[DOMAIN]["context"] = context