Document DHCP discovery (#774)

* Document DHCP discovery

* Update docs/creating_integration_manifest.md

* Update docs/creating_integration_manifest.md

* Update docs/creating_integration_manifest.md
This commit is contained in:
J. Nick Koston 2021-01-13 22:44:19 -10:00 committed by GitHub
parent d3352592aa
commit c608a08865
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 additions and 3 deletions

View File

@ -49,7 +49,8 @@ There are a few step names reserved for system use:
| Step name | Description |
| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `discovery` | _DEPRECATED_ Invoked if your integration has been discovered by the discovery integration. |
| `discovery` | _DEPRECATED_ Invoked if your integration has been discovered by the discovery integration. |
| `dhcp` | Invoked if your integration has been discovered via DHCP as specified [using `dhcp` in the manifest](creating_integration_manifest.md#dhcp). |
| `homekit` | Invoked if your integration has been discovered via HomeKit as specified [using `homekit` in the manifest](creating_integration_manifest.md#homekit). |
| `mqtt` | Invoked if your integration has been discovered via MQTT as specified [using `mqtt` in the manifest](creating_integration_manifest.md#mqtt). |
| `ssdp` | Invoked if your integration has been discovered via SSDP/uPnP as specified [using `ssdp` in the manifest](creating_integration_manifest.md#ssdp). |
@ -68,9 +69,9 @@ 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.
If the integration uses HomeKit, Zeroconf/mDNS or SSDP/uPnP to be discovered, supplying a unique ID is required.
If the integration uses DHCP, HomeKit, Zeroconf/mDNS or SSDP/uPnP to be discovered, supplying a unique ID is required.
If a unique ID isn't available, alternatively, the `zeroconf`, `homekit`, `ssdp` and `discovery` steps can be omitted, even if they are configured in
If a unique ID isn't available, alternatively, the `dhcp`, `zeroconf`, `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

View File

@ -179,6 +179,41 @@ MQTT discovery works by subscribing to MQTT topics specified in the manifest.jso
}
```
## DHCP
If your integration supports discovery via dhcp, you can add the type to your manifest. If the user has the `dhcp` integration loaded, it will load the `dhcp` step of your integration's config flow when it is discovered. We support passively listening for DHCP discovery by the `hostname` and [OUI](https://en.wikipedia.org/wiki/Organizationally_unique_identifier). The manifest value is a list of matcher dictionaries, your integration is discovered if all items of any of the specified matchers are found in the DHCP data. It's up to your config flow to filter out duplicates.
If the integration supports `zeroconf` or `ssdp`, these should be preferred over `dhcp` as it generally offers a better
user experience.
The following example has three matchers consisting of two items. All of the items in any of the three matchers must match for discovery to happen by this config.
For example:
- If the `hostname` was `Rachio-XYZ` and the `macaddress` was `00:9D:6B:55:12:AA`, the discovery would happen.
- If the `hostname` was `Rachio-XYZ` and the `macaddress` was `00:00:00:55:12:AA`, the discovery would not happen.
- If the `hostname` was `NotRachio-XYZ` and the `macaddress` was `00:9D:6B:55:12:AA`, the discovery would not happen.
```json
{
"dhcp": [
{
"hostname": "rachio-*",
"macaddress": "009D6B*"
},
{
"hostname": "rachio-*",
"macaddress": "F0038C*"
},
{
"hostname": "rachio-*",
"macaddress": "74C63B*"
}
]
}
```
## Integration Quality Scale
The [Integration Quality Scale](https://www.home-assistant.io/docs/quality_scale/) scores an integration on the code quality and user experience. Each level of the quality scale consists of a list of requirements. If an integration matches all requirements, it's considered to have reached that level.