From 1f6624ffd85896138000d2021428d9e6e81ee7a9 Mon Sep 17 00:00:00 2001 From: kongo09 Date: Mon, 4 Apr 2022 11:40:19 +0200 Subject: [PATCH] Abort config flow for already_configured (#1280) Co-authored-by: Martin Hjelmare --- docs/config_entries_config_flow_handler.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/config_entries_config_flow_handler.md b/docs/config_entries_config_flow_handler.md index 0ec6d30d..41190d7a 100644 --- a/docs/config_entries_config_flow_handler.md +++ b/docs/config_entries_config_flow_handler.md @@ -70,6 +70,17 @@ await self.async_set_unique_id(device_unique_id) self._abort_if_unique_id_configured() ``` +Should the config flow then abort, the text resource with the key `already_configured` from the `abort` part of your `strings.json` will be displayed to the user in the interface as an abort reason. + +```json +{ + "config": { + "abort": { + "already_configured": "Device is already configured" + } +} +``` + By setting a unique ID, users will have the option to ignore the discovery of your config entry. That way, they won't be bothered about it anymore. If the integration uses DHCP, HomeKit, Zeroconf/mDNS, USB, or SSDP/uPnP to be discovered, supplying a unique ID is required.