Use common srings in xiaomi-miio (#41864)

pull/41873/head
Brig Lamoreaux 2020-10-14 23:09:20 -07:00 committed by GitHub
parent 4146a90313
commit 58a432685c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -111,7 +111,7 @@ class XiaomiMiioFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
},
)
errors["base"] = "connect_error"
errors["base"] = "cannot_connect"
if self.host:
schema = vol.Schema(GATEWAY_SETTINGS)

View File

@ -11,7 +11,7 @@
},
"gateway": {
"title": "Connect to a Xiaomi Gateway",
"description": "You will need the 32 character API Token, see https://www.home-assistant.io/integrations/vacuum.xiaomi_miio/#retrieving-the-access-token for instructions. Please note, that this token is different from the key used by the Xiaomi Aqara integration.",
"description": "You will need the 32 character [%key:common::config_flow::data::api_token%], see https://www.home-assistant.io/integrations/vacuum.xiaomi_miio/#retrieving-the-access-token for instructions. Please note, that this [%key:common::config_flow::data::api_token%] is different from the key used by the Xiaomi Aqara integration.",
"data": {
"host": "[%key:common::config_flow::data::ip%]",
"token": "[%key:common::config_flow::data::api_token%]",
@ -20,7 +20,7 @@
}
},
"error": {
"connect_error": "[%key:common::config_flow::error::cannot_connect%]",
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"no_device_selected": "No device selected, please select one device."
},
"abort": {

View File

@ -90,7 +90,7 @@ async def test_config_flow_step_gateway_connect_error(hass):
assert result["type"] == "form"
assert result["step_id"] == "gateway"
assert result["errors"] == {"base": "connect_error"}
assert result["errors"] == {"base": "cannot_connect"}
async def test_config_flow_gateway_success(hass):