Update to georideapilib 0.2.0

master
Matthieu DUVAL 5 years ago
parent f13daa3322
commit d027e858ce

@ -56,10 +56,12 @@ async def async_setup_entry(hass, entry):
"""Set up Georide entry.""" """Set up Georide entry."""
config = hass.data[DOMAIN]["config"] config = hass.data[DOMAIN]["config"]
email = config.get(CONF_EMAIL) or entry.data[CONF_EMAIL] 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) account = GeorideApi.get_authorisation_token(email, password)
context = GeorideContext( context = GeorideContext(
hass, hass,
email, email,
@ -68,7 +70,7 @@ async def async_setup_entry(hass, entry):
) )
entry["description_placeholders"] = { entry["description_placeholders"] = {
"auth_token": account.auth_token "auth_token": account.auth_token or "null"
} }
hass.data[DOMAIN]["context"] = context hass.data[DOMAIN]["context"] = context

@ -4,7 +4,7 @@
"config_flow": true, "config_flow": true,
"documentation": "https://git.tontontux.fr/mduval/GeorideHA", "documentation": "https://git.tontontux.fr/mduval/GeorideHA",
"requirements": [ "requirements": [
"georideapilib==0.1.0", "georideapilib>=0.2.0",
"urllib3>=1.25.6" "urllib3>=1.25.6"
], ],
"dependencies": [], "dependencies": [],

Loading…
Cancel
Save