Allow None in add_suggested_values_to_schema (#85763)
This commit is contained in:
parent
11a81dc485
commit
13cfd60019
1 changed files with 6 additions and 2 deletions
|
@ -457,7 +457,7 @@ class FlowHandler:
|
|||
return self.context.get("show_advanced_options", False)
|
||||
|
||||
def add_suggested_values_to_schema(
|
||||
self, data_schema: vol.Schema, suggested_values: Mapping[str, Any]
|
||||
self, data_schema: vol.Schema, suggested_values: Mapping[str, Any] | None
|
||||
) -> vol.Schema:
|
||||
"""Make a copy of the schema, populated with suggested values.
|
||||
|
||||
|
@ -477,7 +477,11 @@ class FlowHandler:
|
|||
continue
|
||||
|
||||
new_key = key
|
||||
if key in suggested_values and isinstance(key, vol.Marker):
|
||||
if (
|
||||
suggested_values
|
||||
and key in suggested_values
|
||||
and isinstance(key, vol.Marker)
|
||||
):
|
||||
# Copy the marker to not modify the flow schema
|
||||
new_key = copy.copy(key)
|
||||
new_key.description = {"suggested_value": suggested_values[key]}
|
||||
|
|
Loading…
Add table
Reference in a new issue