Skip to content

Commit

Permalink
fix config flow description not visable #4
Browse files Browse the repository at this point in the history
  • Loading branch information
FaserF committed Oct 17, 2022
1 parent f14f996 commit 76889ef
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 49 deletions.
6 changes: 3 additions & 3 deletions custom_components/deutschebahn/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ 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,
},
)

return self.async_show_form(
step_id="user", data_schema=data_schema, errors=errors
)
)
4 changes: 2 additions & 2 deletions custom_components/deutschebahn/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
23 changes: 9 additions & 14 deletions custom_components/deutschebahn/strings.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
25 changes: 10 additions & 15 deletions custom_components/deutschebahn/translations/de.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
23 changes: 9 additions & 14 deletions custom_components/deutschebahn/translations/en.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
3 changes: 2 additions & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "Deutsche Bahn",
"render_readme": true
"render_readme": true,
"country": ["DE"]
}

0 comments on commit 76889ef

Please sign in to comment.