mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Use common strings for Flu Near You config flow (#41174)
This commit is contained in:
parent
494d4a262a
commit
44580b1c07
@ -53,8 +53,6 @@ class FluNearYouFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
)
|
)
|
||||||
except FluNearYouError as err:
|
except FluNearYouError as err:
|
||||||
LOGGER.error("Error while configuring integration: %s", err)
|
LOGGER.error("Error while configuring integration: %s", err)
|
||||||
return self.async_show_form(
|
return self.async_show_form(step_id="user", errors={"base": "unknown"})
|
||||||
step_id="user", errors={"base": "general_error"}
|
|
||||||
)
|
|
||||||
|
|
||||||
return self.async_create_entry(title=unique_id, data=user_input)
|
return self.async_create_entry(title=unique_id, data=user_input)
|
||||||
|
@ -7,12 +7,14 @@
|
|||||||
"data": {
|
"data": {
|
||||||
"latitude": "[%key:common::config_flow::data::latitude%]",
|
"latitude": "[%key:common::config_flow::data::latitude%]",
|
||||||
"longitude": "[%key:common::config_flow::data::longitude%]"
|
"longitude": "[%key:common::config_flow::data::longitude%]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": { "general_error": "There was an unknown error." },
|
"error": {
|
||||||
|
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||||
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"already_configured": "These coordinates are already registered."
|
"already_configured": "These coordinates are already registered."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -37,7 +37,7 @@ async def test_general_error(hass):
|
|||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
DOMAIN, context={"source": SOURCE_USER}, data=conf
|
DOMAIN, context={"source": SOURCE_USER}, data=conf
|
||||||
)
|
)
|
||||||
assert result["errors"] == {"base": "general_error"}
|
assert result["errors"] == {"base": "unknown"}
|
||||||
|
|
||||||
|
|
||||||
async def test_show_form(hass):
|
async def test_show_form(hass):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user