mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 11:47:06 +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"
|
||||
) as custom_sentences_file:
|
||||
# Merge custom sentences
|
||||
merge_dict(
|
||||
intents_dict, yaml.safe_load(custom_sentences_file)
|
||||
)
|
||||
if isinstance(
|
||||
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
|
||||
intents_changed = True
|
||||
|
Loading…
x
Reference in New Issue
Block a user