From 490cc3253fcadec403c2df2a92e74a48d67da38c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Fri, 18 Jul 2025 21:57:17 +0200 Subject: [PATCH 1/2] ObstructionDetected Attribute within the Eve Cluster --- matter_server/common/custom_clusters.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index 80ec53bb..2cb6ab40 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -114,6 +114,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor( Label="current", Tag=0x130A0009, Type=float32 ), + ClusterObjectFieldDescriptor( + Label="obstructionDetected", Tag=0x130A0010, Type=bool + ), ClusterObjectFieldDescriptor( Label="altitude", Tag=0x130A0013, Type=float32 ), @@ -143,6 +146,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: weatherTrend: int | None = None valvePosition: int | None = None motionSensitivity: int | None = None + obstructionDetected:bool | None = None class Attributes: """Attributes for the Eve Cluster.""" @@ -285,6 +289,27 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: float32 = 0 + @dataclass + class ObstructionDetected(ClusterAttributeDescriptor, CustomClusterAttributeMixin): + """ObstructionDetected Attribute within the Eve Cluster.""" + + @ChipUtility.classproperty + def cluster_id(cls) -> int: + """Return cluster id.""" + return 0x130AFC01 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + """Return attribute id.""" + return 0x130A0010 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + """Return attribute type.""" + return ClusterObjectFieldDescriptor(Type=bool) + + value: bool = False + @dataclass class Altitude(ClusterAttributeDescriptor, CustomClusterAttributeMixin): """Altitude Attribute within the Eve Cluster.""" From 3aee5a31445d6ac59c59db85ee826e433f301282 Mon Sep 17 00:00:00 2001 From: Ludovic BOUE Date: Fri, 18 Jul 2025 22:12:56 +0200 Subject: [PATCH 2/2] Lint fix --- matter_server/common/custom_clusters.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index 2cb6ab40..47431e7a 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -146,7 +146,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: weatherTrend: int | None = None valvePosition: int | None = None motionSensitivity: int | None = None - obstructionDetected:bool | None = None + obstructionDetected: bool | None = None class Attributes: """Attributes for the Eve Cluster.""" @@ -290,7 +290,9 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: float32 = 0 @dataclass - class ObstructionDetected(ClusterAttributeDescriptor, CustomClusterAttributeMixin): + class ObstructionDetected( + ClusterAttributeDescriptor, CustomClusterAttributeMixin + ): """ObstructionDetected Attribute within the Eve Cluster.""" @ChipUtility.classproperty