From 8429ec2fb53882552741876041d81e5ddfcc26aa Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 5 Mar 2021 10:12:08 -1000 Subject: [PATCH] Update config entry Unique ID Requirements (#834) Co-authored-by: Martin Hjelmare --- docs/config_entries_config_flow_handler.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/config_entries_config_flow_handler.md b/docs/config_entries_config_flow_handler.md index 8b476ded..5d2c9d89 100644 --- a/docs/config_entries_config_flow_handler.md +++ b/docs/config_entries_config_flow_handler.md @@ -85,11 +85,11 @@ await self._async_handle_discovery_without_unique_id() ### Unique ID Requirements -A Unique ID is used to match a config entry to the underlying device or api. The Unique ID must be stable and should not be able to be changed by the user. The Unique ID can be used to update the config entry data when device access details change. For example, for devices that communicate over the local network, if the IP address changes due a new DHCP assignment, the integration can use the Unique ID to update the host using the following code snippet: +A Unique ID is used to match a config entry to the underlying device or API. The Unique ID must be stable and should not be able to be changed by the user. The Unique ID can be used to update the config entry data when device access details change. For example, for devices that communicate over the local network, if the IP address changes due to a new DHCP assignment, the integration can use the Unique ID to update the host using the following code snippet: ``` await self.async_set_unique_id(serial_number) - self._abort_if_unique_id_configured({CONF_HOST: host, CONF_PORT: port}) + self._abort_if_unique_id_configured(updates={CONF_HOST: host, CONF_PORT: port}) ``` #### Example acceptable sources for a unique ID @@ -113,6 +113,8 @@ A Unique ID is used to match a config entry to the underlying device or api. The - IP Address - Device Name +- Hostname +- URL ### Unignoring