1
mirror of https://github.com/home-assistant/core synced 2024-07-27 18:58:57 +02:00

Use reference strings in Bsblan (#41049)

* Update strings.json

* Update config_flow.py

* Update test_config_flow.py

* Update strings.json
This commit is contained in:
SNoof85 2020-10-02 21:43:13 +02:00 committed by GitHub
parent 65611320d4
commit 4ab479d48d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -39,7 +39,7 @@ class BSBLanFlowHandler(ConfigFlow, domain=DOMAIN):
passkey=user_input.get(CONF_PASSKEY),
)
except BSBLanError:
return self._show_setup_form({"base": "connection_error"})
return self._show_setup_form({"base": "cannot_connect"})
# Check if already configured
await self.async_set_unique_id(info.device_identification)

View File

@ -14,10 +14,10 @@
}
},
"error": {
"connection_error": "Failed to connect to BSB-Lan device."
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
},
"abort": {
"already_configured": "Device is already configured"
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
}
}
}
}

View File

@ -40,7 +40,7 @@ async def test_connection_error(
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["type"] == data_entry_flow.RESULT_TYPE_FORM