mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Fix error if a custom_sentences
file is empty (#93530)
* Fix #93528 * Log warning file is invalid * More explicit log warning message * Rewrite log message
This commit is contained in:
parent
d7d9143a44
commit
fe472e6c5b
@ -413,9 +413,18 @@ class DefaultAgent(AbstractConversationAgent):
|
|||||||
encoding="utf-8"
|
encoding="utf-8"
|
||||||
) as custom_sentences_file:
|
) as custom_sentences_file:
|
||||||
# Merge custom sentences
|
# Merge custom sentences
|
||||||
merge_dict(
|
if isinstance(
|
||||||
intents_dict, yaml.safe_load(custom_sentences_file)
|
custom_sentences_yaml := yaml.safe_load(
|
||||||
)
|
custom_sentences_file
|
||||||
|
),
|
||||||
|
dict,
|
||||||
|
):
|
||||||
|
merge_dict(intents_dict, custom_sentences_yaml)
|
||||||
|
else:
|
||||||
|
_LOGGER.warning(
|
||||||
|
"Custom sentences file does not match expected format path=%s",
|
||||||
|
custom_sentences_file.name,
|
||||||
|
)
|
||||||
|
|
||||||
# Will need to recreate graph
|
# Will need to recreate graph
|
||||||
intents_changed = True
|
intents_changed = True
|
||||||
|
Loading…
x
Reference in New Issue
Block a user