Improve WS command validate_config (#118864)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com> Co-authored-by: Robert Resch <robert@resch.dev>
This commit is contained in:
parent
6efc3b95a4
commit
8099ea8817
2 changed files with 30 additions and 7 deletions
|
@ -862,7 +862,10 @@ async def handle_validate_config(
|
|||
|
||||
try:
|
||||
await validator(hass, schema(msg[key]))
|
||||
except vol.Invalid as err:
|
||||
except (
|
||||
vol.Invalid,
|
||||
HomeAssistantError,
|
||||
) as err:
|
||||
result[key] = {"valid": False, "error": str(err)}
|
||||
else:
|
||||
result[key] = {"valid": True, "error": None}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue