Use reference strings in Bsblan (#41049)
* Update strings.json * Update config_flow.py * Update test_config_flow.py * Update strings.jsonpull/39732/head
parent
65611320d4
commit
4ab479d48d
|
@ -39,7 +39,7 @@ class BSBLanFlowHandler(ConfigFlow, domain=DOMAIN):
|
||||||
passkey=user_input.get(CONF_PASSKEY),
|
passkey=user_input.get(CONF_PASSKEY),
|
||||||
)
|
)
|
||||||
except BSBLanError:
|
except BSBLanError:
|
||||||
return self._show_setup_form({"base": "connection_error"})
|
return self._show_setup_form({"base": "cannot_connect"})
|
||||||
|
|
||||||
# Check if already configured
|
# Check if already configured
|
||||||
await self.async_set_unique_id(info.device_identification)
|
await self.async_set_unique_id(info.device_identification)
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"connection_error": "Failed to connect to BSB-Lan device."
|
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"already_configured": "Device is already configured"
|
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ async def test_connection_error(
|
||||||
data={CONF_HOST: "example.local", CONF_PASSKEY: "1234", CONF_PORT: 80},
|
data={CONF_HOST: "example.local", CONF_PASSKEY: "1234", CONF_PORT: 80},
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result["errors"] == {"base": "connection_error"}
|
assert result["errors"] == {"base": "cannot_connect"}
|
||||||
assert result["step_id"] == "user"
|
assert result["step_id"] == "user"
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue