diff --git a/custom_components/georide/__init__.py b/custom_components/georide/__init__.py index 79b5e21..ba57c93 100644 --- a/custom_components/georide/__init__.py +++ b/custom_components/georide/__init__.py @@ -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 diff --git a/custom_components/georide/manifest.json b/custom_components/georide/manifest.json index 66d9837..c4e74da 100644 --- a/custom_components/georide/manifest.json +++ b/custom_components/georide/manifest.json @@ -4,7 +4,7 @@ "config_flow": true, "documentation": "https://git.tontontux.fr/mduval/GeorideHA", "requirements": [ - "georideapilib==0.1.0", + "georideapilib>=0.2.0", "urllib3>=1.25.6" ], "dependencies": [],