Add documentation for discovery without unique ID (#578)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Franck Nijhof 2020-06-15 14:22:13 +02:00 committed by GitHub
parent df35dd2b40
commit 146513a196
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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