Add unique id check in wiffi config flow (#60388)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
pull/62999/head
Steffen Zimmermann 2021-12-29 14:34:47 +01:00 committed by GitHub
parent 98135d8158
commit 85f2e259da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,8 @@ class WiffiFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
return self._async_show_form()
# received input from form or configuration.yaml
await self.async_set_unique_id(user_input[CONF_PORT])
self._abort_if_unique_id_configured()
try:
# try to start server to check whether port is in use

View File

@ -10,6 +10,7 @@
},
"abort": {
"addr_in_use": "Server port already in use.",
"already_configured": "Server port is already configured.",
"start_server_failed": "Start server failed."
}
},

View File

@ -2,6 +2,7 @@
"config": {
"abort": {
"addr_in_use": "Server port already in use.",
"already_configured": "Server port is already configured.",
"start_server_failed": "Start server failed."
},
"step": {