mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-13 12:26:29 +00:00
Add documentation for discovery without unique ID (#578)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
df35dd2b40
commit
146513a196
@ -66,7 +66,20 @@ await self.async_set_unique_id(device_unique_id)
|
||||
self._abort_if_unique_id_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.
|
||||
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 HomeKit, Zeroconf/mDNS or SSDP/uPnP to be discovered, supplying a unique ID is required.
|
||||
|
||||
If a unique ID isn't available, alternatively, the `zerconf`, `homekit`, `ssdp` and `discovery` steps can be omitted, even if they are configured in
|
||||
the integration manifest. In that case, the `user` step will be called when the item is discovered.
|
||||
|
||||
Alternatively, if an integration can't get a unique ID all the time (e.g., multiple devices, some have one, some don't), a helper is available
|
||||
that still allows for discovery, as long as there aren't any instances of the integrations configured yet.
|
||||
|
||||
```python
|
||||
if device_unique_id:
|
||||
await self.async_set_unique_id(device_unique_id)
|
||||
await self._async_handle_discovery_without_unique_id()
|
||||
```
|
||||
|
||||
### Unignoring
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user