Improve resource validation in scrape config flow (#82965)
* Improve resource validation in scrape * Coverage
This commit is contained in:
parent
cd2bb292ab
commit
92fef0f2ba
2 changed files with 20 additions and 1 deletions
|
@ -123,9 +123,12 @@ async def validate_rest_setup(
|
|||
hass = async_get_hass()
|
||||
rest_config: dict[str, Any] = COMBINED_SCHEMA(user_input)
|
||||
try:
|
||||
create_rest_data_from_config(hass, rest_config)
|
||||
rest = create_rest_data_from_config(hass, rest_config)
|
||||
await rest.async_update()
|
||||
except Exception as err:
|
||||
raise SchemaFlowError("resource_error") from err
|
||||
if rest.data is None:
|
||||
raise SchemaFlowError("resource_error")
|
||||
return user_input
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue