Add product_id support to Matter discovery schemas (#151307)

This commit is contained in:
Ludovic BOUÉ
2025-08-28 15:57:40 +02:00
committed by GitHub
parent 6b3f2e9b7b
commit e94a7b2ec1
3 changed files with 11 additions and 1 deletions

View File

@@ -78,6 +78,13 @@ def async_discover_entities(
):
continue
# check product_id
if (
schema.product_id is not None
and device_info.productID not in schema.product_id
):
continue
# check product_name
if (
schema.product_name is not None

View File

@@ -100,6 +100,9 @@ class MatterDiscoverySchema:
# [optional] the endpoint's vendor_id must match ANY of these values
vendor_id: tuple[int, ...] | None = None
# [optional] the endpoint's product_id must match ANY of these values
product_id: tuple[int, ...] | None = None
# [optional] the endpoint's product_name must match ANY of these values
product_name: tuple[str, ...] | None = None

View File

@@ -525,6 +525,6 @@ DISCOVERY_SCHEMAS = [
clusters.BooleanStateConfiguration.Attributes.CurrentSensitivityLevel,
),
vendor_id=(4447,),
product_name=("Aqara Door and Window Sensor P2",),
product_id=(8194,),
),
]