diff --git a/custom_components/georide/.translations/en.json b/custom_components/georide/.translations/en.json index 4bae62f..85055ad 100644 --- a/custom_components/georide/.translations/en.json +++ b/custom_components/georide/.translations/en.json @@ -1,10 +1,10 @@ { "config": { - "title": "Georide", + "title": "GeoRide", "step": { "user": { - "title": "Set up Georide", - "description": "Are you sure you want to set up Georide?", + "title": "Set up GeoRide", + "description": "Are you sure you want to set up GeoRide ?", "data": { "email": "email", "password": "password" diff --git a/custom_components/georide/__init__.py b/custom_components/georide/__init__.py index 412e74f..12d62bb 100644 --- a/custom_components/georide/__init__.py +++ b/custom_components/georide/__init__.py @@ -63,7 +63,8 @@ async def async_setup_entry(hass, entry): password ) hass.data[DOMAIN]["context"] = context - """ hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "device_tracker") ) """ + hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, "device_tracker")) + return True diff --git a/custom_components/georide/config_flow.py b/custom_components/georide/config_flow.py index f104da3..54a34f1 100644 --- a/custom_components/georide/config_flow.py +++ b/custom_components/georide/config_flow.py @@ -10,8 +10,6 @@ from .const import CONF_EMAIL, CONF_PASSWORD _LOGGER = logging.getLogger(__name__) -STEP_ID = 'user' - @config_entries.HANDLERS.register("georide") class GeorideConfigFlow(config_entries.ConfigFlow): """Georide config flow """ @@ -23,16 +21,18 @@ class GeorideConfigFlow(config_entries.ConfigFlow): return self.async_abort(reason="one_instance_allowed") if user_input is None: - _LOGGER.info("user email: %", str(user_input)) - - return self.async_show_form(step_id=STEP_ID, data_schema=vol.Schema({ + return self.async_show_form(step_id='user', data_schema=vol.Schema({ vol.Required(CONF_EMAIL): vol.All(str, vol.Length(min=3)), vol.Required(CONF_PASSWORD): vol.All(str) })) - # process info - - return self.async_abort(reason="no_credentials") + return self.async_create_entry( + title=user_input[CONF_EMAIL], + data={ + CONF_EMAIL: user_input[CONF_EMAIL], + CONF_PASSWORD: user_input[CONF_PASSWORD] + } + ) @@ -42,10 +42,10 @@ class GeorideConfigFlow(config_entries.ConfigFlow): _LOGGER.info("user email: %", str(user_input)) return self.async_create_entry( - title="Georide", + title=user_input[CONF_EMAIL] + "machin", data={ - CONF_EMAIL: "un_emal", - CONF_PASSWORD: "un password" - }, + CONF_EMAIL: user_input[CONF_EMAIL], + CONF_PASSWORD: user_input[CONF_PASSWORD] + } ) \ No newline at end of file diff --git a/custom_components/georide/strings.json b/custom_components/georide/strings.json index 4bae62f..85055ad 100644 --- a/custom_components/georide/strings.json +++ b/custom_components/georide/strings.json @@ -1,10 +1,10 @@ { "config": { - "title": "Georide", + "title": "GeoRide", "step": { "user": { - "title": "Set up Georide", - "description": "Are you sure you want to set up Georide?", + "title": "Set up GeoRide", + "description": "Are you sure you want to set up GeoRide ?", "data": { "email": "email", "password": "password"