mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Add value is not to Matter discovery schema logic (#136157)
This commit is contained in:
parent
364556a7dd
commit
f422ad22c4
@ -130,6 +130,15 @@ def async_discover_entities(
|
||||
):
|
||||
continue
|
||||
|
||||
# check for value that may not be present
|
||||
if schema.value_is_not is not None and (
|
||||
schema.value_is_not == primary_value
|
||||
or (
|
||||
isinstance(primary_value, list) and schema.value_is_not in primary_value
|
||||
)
|
||||
):
|
||||
continue
|
||||
|
||||
# check for required value in cluster featuremap
|
||||
if schema.featuremap_contains is not None and (
|
||||
not bool(
|
||||
|
@ -116,6 +116,11 @@ class MatterDiscoverySchema:
|
||||
# NOTE: only works for list values
|
||||
value_contains: Any | None = None
|
||||
|
||||
# [optional] the primary attribute value must NOT have this value
|
||||
# for example to filter out invalid values (such as empty string instead of null)
|
||||
# in case of a list value, the list may not contain this value
|
||||
value_is_not: Any | None = None
|
||||
|
||||
# [optional] the primary attribute's cluster featuremap must contain this value
|
||||
# for example for the DoorSensor on a DoorLock Cluster
|
||||
featuremap_contains: int | None = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user