Use common srings in xiaomi-miio (#41864)
parent
4146a90313
commit
58a432685c
|
@ -111,7 +111,7 @@ class XiaomiMiioFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
errors["base"] = "connect_error"
|
errors["base"] = "cannot_connect"
|
||||||
|
|
||||||
if self.host:
|
if self.host:
|
||||||
schema = vol.Schema(GATEWAY_SETTINGS)
|
schema = vol.Schema(GATEWAY_SETTINGS)
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
},
|
},
|
||||||
"gateway": {
|
"gateway": {
|
||||||
"title": "Connect to a Xiaomi 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": {
|
"data": {
|
||||||
"host": "[%key:common::config_flow::data::ip%]",
|
"host": "[%key:common::config_flow::data::ip%]",
|
||||||
"token": "[%key:common::config_flow::data::api_token%]",
|
"token": "[%key:common::config_flow::data::api_token%]",
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"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."
|
"no_device_selected": "No device selected, please select one device."
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
|
|
|
@ -90,7 +90,7 @@ async def test_config_flow_step_gateway_connect_error(hass):
|
||||||
|
|
||||||
assert result["type"] == "form"
|
assert result["type"] == "form"
|
||||||
assert result["step_id"] == "gateway"
|
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):
|
async def test_config_flow_gateway_success(hass):
|
||||||
|
|
Loading…
Reference in New Issue