Skip to content

Commit e94a7b2

Browse files
authored
Add product_id support to Matter discovery schemas (home-assistant#151307)
1 parent 6b3f2e9 commit e94a7b2

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

homeassistant/components/matter/discovery.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ def async_discover_entities(
7878
):
7979
continue
8080

81+
# check product_id
82+
if (
83+
schema.product_id is not None
84+
and device_info.productID not in schema.product_id
85+
):
86+
continue
87+
8188
# check product_name
8289
if (
8390
schema.product_name is not None

homeassistant/components/matter/models.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ class MatterDiscoverySchema:
100100
# [optional] the endpoint's vendor_id must match ANY of these values
101101
vendor_id: tuple[int, ...] | None = None
102102

103+
# [optional] the endpoint's product_id must match ANY of these values
104+
product_id: tuple[int, ...] | None = None
105+
103106
# [optional] the endpoint's product_name must match ANY of these values
104107
product_name: tuple[str, ...] | None = None
105108

homeassistant/components/matter/select.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,6 @@ def _update_from_device(self) -> None:
525525
clusters.BooleanStateConfiguration.Attributes.CurrentSensitivityLevel,
526526
),
527527
vendor_id=(4447,),
528-
product_name=("Aqara Door and Window Sensor P2",),
528+
product_id=(8194,),
529529
),
530530
]

0 commit comments

Comments
 (0)