From 8e2b7906b936c920bafd4b47dacd427d316224d3 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 24 Jul 2022 16:57:04 -0500 Subject: [PATCH] Update bluetooth matchers to support service_data_uuid (#1410) * Update bluetooth matchers to support service_data_uuid * Update bluetooth matchers to support service_data_uuid * fix reversal * Update docs/creating_integration_manifest.md --- docs/creating_integration_manifest.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/creating_integration_manifest.md b/docs/creating_integration_manifest.md index 645d4317..82d43b01 100644 --- a/docs/creating_integration_manifest.md +++ b/docs/creating_integration_manifest.md @@ -160,7 +160,7 @@ Result (this is intended functionality for the near feature): ## Bluetooth -If your integration supports discovery via bluetooth, you can add a matcher to your manifest. If the user has the `bluetooth` integration loaded, it will load the `bluetooth` step of your integration's config flow when it is discovered. We support listening for Bluetooth discovery by matching on `local_name`, `service_uuid`, `manufacturer_id`, and `manufacturer_data_start`. The `manufacturer_data_start` field expects a list of bytes encoded as integer values from 0-255. 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 Bluetooth data. It's up to your config flow to filter out duplicates. +If your integration supports discovery via bluetooth, you can add a matcher to your manifest. If the user has the `bluetooth` integration loaded, it will load the `bluetooth` step of your integration's config flow when it is discovered. We support listening for Bluetooth discovery by matching on `local_name`, `service_uuid`, `service_data_uuid`, `manufacturer_id`, and `manufacturer_data_start`. The `manufacturer_data_start` field expects a list of bytes encoded as integer values from 0-255. 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 Bluetooth data. It's up to your config flow to filter out duplicates. The following example will match Nespresso Prodigio machines: @@ -174,13 +174,25 @@ The following example will match Nespresso Prodigio machines: } ``` -The following example will match a service uuid used for SwitchBot devices: +The following example will match a service uuid used for SwitchBot bot and curtain devices: ```json { "bluetooth": [ { - "service_uuids": ["cba20d00-224d-11e6-9fb8-0002a5d5c51b"] + "service_uuid": ["cba20d00-224d-11e6-9fb8-0002a5d5c51b"] + } + ] +} +``` + +The following example will match a service data uuid used for SwitchBot sensor devices: + +```json +{ + "bluetooth": [ + { + "service_data_uuid": ["0000fd3d-0000-1000-8000-00805f9b34fb"] } ] }