mirror of
https://github.com/home-assistant/core.git
synced 2025-12-27 14:31:13 +00:00
Deprecate legacy api auth provider (#104409)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
@@ -215,6 +215,29 @@ def gen_data_entry_schema(
|
||||
return vol.All(*validators)
|
||||
|
||||
|
||||
def gen_issues_schema(config: Config, integration: Integration) -> dict[str, Any]:
|
||||
"""Generate the issues schema."""
|
||||
return {
|
||||
str: vol.All(
|
||||
cv.has_at_least_one_key("description", "fix_flow"),
|
||||
vol.Schema(
|
||||
{
|
||||
vol.Required("title"): translation_value_validator,
|
||||
vol.Exclusive(
|
||||
"description", "fixable"
|
||||
): translation_value_validator,
|
||||
vol.Exclusive("fix_flow", "fixable"): gen_data_entry_schema(
|
||||
config=config,
|
||||
integration=integration,
|
||||
flow_title=UNDEFINED,
|
||||
require_step_title=False,
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
def gen_strings_schema(config: Config, integration: Integration) -> vol.Schema:
|
||||
"""Generate a strings schema."""
|
||||
return vol.Schema(
|
||||
@@ -266,25 +289,7 @@ def gen_strings_schema(config: Config, integration: Integration) -> vol.Schema:
|
||||
vol.Optional("application_credentials"): {
|
||||
vol.Optional("description"): translation_value_validator,
|
||||
},
|
||||
vol.Optional("issues"): {
|
||||
str: vol.All(
|
||||
cv.has_at_least_one_key("description", "fix_flow"),
|
||||
vol.Schema(
|
||||
{
|
||||
vol.Required("title"): translation_value_validator,
|
||||
vol.Exclusive(
|
||||
"description", "fixable"
|
||||
): translation_value_validator,
|
||||
vol.Exclusive("fix_flow", "fixable"): gen_data_entry_schema(
|
||||
config=config,
|
||||
integration=integration,
|
||||
flow_title=UNDEFINED,
|
||||
require_step_title=False,
|
||||
),
|
||||
},
|
||||
),
|
||||
)
|
||||
},
|
||||
vol.Optional("issues"): gen_issues_schema(config, integration),
|
||||
vol.Optional("entity_component"): cv.schema_with_slug_keys(
|
||||
{
|
||||
vol.Optional("name"): str,
|
||||
@@ -362,7 +367,8 @@ def gen_auth_schema(config: Config, integration: Integration) -> vol.Schema:
|
||||
flow_title=REQUIRED,
|
||||
require_step_title=True,
|
||||
)
|
||||
}
|
||||
},
|
||||
vol.Optional("issues"): gen_issues_schema(config, integration),
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user