Add model_id filter to device selector (#135646)

* Add model_id filter to device selector

* Rerun CI
This commit is contained in:
karwosts 2025-03-02 12:15:37 -08:00 committed by GitHub
parent 8536f2b4cb
commit fa40d02a07
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -164,6 +164,8 @@ DEVICE_FILTER_SELECTOR_CONFIG_SCHEMA = vol.Schema(
vol.Optional("manufacturer"): str,
# Model of device
vol.Optional("model"): str,
# Model ID of device
vol.Optional("model_id"): str,
# Device has to contain entities matching this selector
vol.Optional("entity"): vol.All(
cv.ensure_list, [ENTITY_FILTER_SELECTOR_CONFIG_SCHEMA]
@ -178,6 +180,7 @@ class DeviceFilterSelectorConfig(TypedDict, total=False):
integration: str
manufacturer: str
model: str
model_id: str
class ActionSelectorConfig(TypedDict):

View File

@ -88,6 +88,7 @@ def _test_selector(
({"integration": "zha"}, ("abc123",), (None,)),
({"manufacturer": "mock-manuf"}, ("abc123",), (None,)),
({"model": "mock-model"}, ("abc123",), (None,)),
({"model_id": "mock-model_id"}, ("abc123",), (None,)),
({"manufacturer": "mock-manuf", "model": "mock-model"}, ("abc123",), (None,)),
(
{"integration": "zha", "manufacturer": "mock-manuf", "model": "mock-model"},