From 3d62b0a4cd88692b68e5ead0b1cf3c4196d39a35 Mon Sep 17 00:00:00 2001 From: dougiteixeira <31328123+dougiteixeira@users.noreply.github.com> Date: Wed, 26 Jul 2023 03:29:47 -0300 Subject: [PATCH] Add documentation for device info categorization (#1858) Co-authored-by: Franck Nijhof --- docs/device_registry_index.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/device_registry_index.md b/docs/device_registry_index.md index 3f9b870a..048e1693 100644 --- a/docs/device_registry_index.md +++ b/docs/device_registry_index.md @@ -111,3 +111,17 @@ async def async_remove_config_entry_device( When the user clicks the delete device button for the device and confirms it, `async_remove_config_entry_device` will be awaited and if `True` is returned, the config entry will be removed from the device. If it was the only config entry of the device, the device will be removed from the device registry. In `async_remove_config_entry_device` the integration should take the necessary steps to prepare for device removal and return `True` if successful. The integration may optionally act on `EVENT_DEVICE_REGISTRY_UPDATED` if that's more convenient than doing the cleanup in `async_remove_config_entry_device`. + +## Categorizing to Device Info + +Device info is categorized into Link, Primary and Secondary by finding the first device info type which has all the keys of the device info. + +| Category | Keys | +| -------------------- | ---------------------| +| Link | `connections` and `identifiers` | +| Primary | `configuration_url`, `connections`, `entry_type`, `hw_version`, `identifiers`, `manufacturer`, `model`, `name`, `suggested_area`, `sw_version`, and `via_device`| +| Secondary | `connections`, `default_manufacturer`, `default_model`, `default_name`, and `via_device`| + +This categorization is used in sorting the configuration entries to define the main integration to be used by the frontend. + +Mandatorily, the device info must match one of the categories.