Skip to content

Commit ee0c4b1

Browse files
authored
Make certain fields required for subentry flows (home-assistant#156251)
1 parent 507f541 commit ee0c4b1

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

homeassistant/components/telegram_bot/strings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
"abort": {
8585
"already_configured": "Chat already configured"
8686
},
87+
"entry_type": "Allowed chat ID",
8788
"error": {
8889
"chat_not_found": "Chat not found"
8990
},

script/hassfest/translations.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ def gen_data_entry_schema(
174174
flow_title: int,
175175
require_step_title: bool,
176176
mandatory_description: str | None = None,
177+
subentry_flow: bool = False,
177178
) -> vol.All:
178179
"""Generate a data entry schema."""
179180
step_title_class = vol.Required if require_step_title else vol.Optional
@@ -206,9 +207,13 @@ def gen_data_entry_schema(
206207
vol.Optional("abort"): {str: translation_value_validator},
207208
vol.Optional("progress"): {str: translation_value_validator},
208209
vol.Optional("create_entry"): {str: translation_value_validator},
209-
vol.Optional("initiate_flow"): {str: translation_value_validator},
210-
vol.Optional("entry_type"): translation_value_validator,
211210
}
211+
if subentry_flow:
212+
schema[vol.Required("entry_type")] = translation_value_validator
213+
schema[vol.Required("initiate_flow")] = {
214+
vol.Required("user"): translation_value_validator,
215+
str: translation_value_validator,
216+
}
212217
if flow_title == REQUIRED:
213218
schema[vol.Required("title")] = translation_value_validator
214219
elif flow_title == REMOVED:
@@ -314,6 +319,7 @@ def gen_strings_schema(config: Config, integration: Integration) -> vol.Schema:
314319
integration=integration,
315320
flow_title=REMOVED,
316321
require_step_title=False,
322+
subentry_flow=True,
317323
),
318324
slug_validator=vol.Any("_", cv.slug),
319325
),

0 commit comments

Comments
 (0)