From 76889ef3921646ecfaf0261be7538b7644219a31 Mon Sep 17 00:00:00 2001 From: Fabian Seitz Date: Mon, 17 Oct 2022 16:08:55 +0200 Subject: [PATCH] fix config flow description not visable #4 --- custom_components/deutschebahn/config_flow.py | 6 ++--- custom_components/deutschebahn/const.py | 4 +-- custom_components/deutschebahn/strings.json | 23 +++++++---------- .../deutschebahn/translations/de.json | 25 ++++++++----------- .../deutschebahn/translations/en.json | 23 +++++++---------- hacs.json | 3 ++- 6 files changed, 35 insertions(+), 49 deletions(-) diff --git a/custom_components/deutschebahn/config_flow.py b/custom_components/deutschebahn/config_flow.py index 174109b..c4575e3 100644 --- a/custom_components/deutschebahn/config_flow.py +++ b/custom_components/deutschebahn/config_flow.py @@ -40,8 +40,8 @@ async def async_step_user(self, user_input=None): data_schema = vol.Schema( { - vol.Required(CONF_START, default="Start"): str, - vol.Required(CONF_DESTINATION, default="Destination"): str, + vol.Required(CONF_START): str, + vol.Required(CONF_DESTINATION): str, vol.Required(CONF_OFFSET, default=0): cv.positive_int, vol.Required(CONF_ONLY_DIRECT, default=False): cv.boolean, }, @@ -49,4 +49,4 @@ async def async_step_user(self, user_input=None): return self.async_show_form( step_id="user", data_schema=data_schema, errors=errors - ) + ) \ No newline at end of file diff --git a/custom_components/deutschebahn/const.py b/custom_components/deutschebahn/const.py index 84abc41..466d7d1 100644 --- a/custom_components/deutschebahn/const.py +++ b/custom_components/deutschebahn/const.py @@ -2,8 +2,8 @@ DOMAIN = "deutschebahn" ATTRIBUTION = "Data provided by bahn.de api" -CONF_DESTINATION = "to" -CONF_START = "from" +CONF_DESTINATION = "destination" +CONF_START = "start" CONF_OFFSET = "offset" CONF_ONLY_DIRECT = "only_direct" diff --git a/custom_components/deutschebahn/strings.json b/custom_components/deutschebahn/strings.json index d0c96b2..8226e15 100644 --- a/custom_components/deutschebahn/strings.json +++ b/custom_components/deutschebahn/strings.json @@ -1,28 +1,23 @@ { "config": { - "error": { - "invalid_station": "Invalid Start / Destination station", - "unknown": "Unknown Error" - }, - "abort": { - "already_configured": "This start & Destination combination is already configured" - }, + "flow_title": "Setup DeutscheBahn", "step": { "user": { - "title": "Setup DeutscheBahn", "description": "Submit your train station details for the search queries.", "data": { "start": "Start station", "destination": "Destination station", "offset": "Offset in minutes", - "only direct": "Only show direct connections?" + "only_direct": "Only show direct connections?" } } - } - }, - "system_health": { - "info": { - "version": "Version" + }, + "abort": { + "already_configured": "This start & Destination combination is already configured" + }, + "error": { + "invalid_station": "Invalid Start / Destination station", + "unknown": "Unknown Error" } } } \ No newline at end of file diff --git a/custom_components/deutschebahn/translations/de.json b/custom_components/deutschebahn/translations/de.json index 35272f6..b33a7f1 100644 --- a/custom_components/deutschebahn/translations/de.json +++ b/custom_components/deutschebahn/translations/de.json @@ -1,28 +1,23 @@ { "config": { - "error": { - "invalid_station": "Ungültige Start/Ziel Station", - "unknown": "Unbekannter Fehler" - }, - "abort": { - "already_configured": "Diese Start & Ziel Station Kombination ist bereits konfiguriert." - }, + "flow_title": "Einrichtung der DeutscheBahn Integration", "step": { "user": { - "title": "Einrichtung der DeutscheBahn Integration", "description": "Trage hier deine Zug Station Informationen ein für die Suchabfrage.", "data": { "start": "Start Station", - "destination": "Ziel Station", + "destination": "Ziel station", "offset": "Versatz in Minutes", - "only direct": "Zeige nur direkte Verbindungen?" + "only_direct": "Zeige nur direkte Verbindungen?" } } - } - }, - "system_health": { - "info": { - "version": "Version" + }, + "abort": { + "already_configured": "Diese Start & Ziel Station Kombination ist bereits konfiguriert." + }, + "error": { + "invalid_station": "Ungültige Start/Ziel Station", + "unknown": "Unbekannter Fehler" } } } \ No newline at end of file diff --git a/custom_components/deutschebahn/translations/en.json b/custom_components/deutschebahn/translations/en.json index d0c96b2..8226e15 100644 --- a/custom_components/deutschebahn/translations/en.json +++ b/custom_components/deutschebahn/translations/en.json @@ -1,28 +1,23 @@ { "config": { - "error": { - "invalid_station": "Invalid Start / Destination station", - "unknown": "Unknown Error" - }, - "abort": { - "already_configured": "This start & Destination combination is already configured" - }, + "flow_title": "Setup DeutscheBahn", "step": { "user": { - "title": "Setup DeutscheBahn", "description": "Submit your train station details for the search queries.", "data": { "start": "Start station", "destination": "Destination station", "offset": "Offset in minutes", - "only direct": "Only show direct connections?" + "only_direct": "Only show direct connections?" } } - } - }, - "system_health": { - "info": { - "version": "Version" + }, + "abort": { + "already_configured": "This start & Destination combination is already configured" + }, + "error": { + "invalid_station": "Invalid Start / Destination station", + "unknown": "Unknown Error" } } } \ No newline at end of file diff --git a/hacs.json b/hacs.json index 50b0434..4842715 100644 --- a/hacs.json +++ b/hacs.json @@ -1,4 +1,5 @@ { "name": "Deutsche Bahn", - "render_readme": true + "render_readme": true, + "country": ["DE"] } \ No newline at end of file