Improve wiffi config flow handling (#63167)

Don't use `async_set_unique_id` and `_abort_if_unique_id_configured`
because TCP port number is not a unique id.

Use `_async_abort_entries_match` instead.
This commit is contained in:
Steffen Zimmermann
2022-01-01 20:36:45 +01:00
committed by GitHub
parent 81aff973ea
commit 9ead2c7148

View File

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