From 70f83a6c77a2d159f66008ba00a07826cf300025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sat, 14 Sep 2024 17:23:41 +0200 Subject: [PATCH 1/3] MotionSensitivity Attribute within the Eve Cluster --- matter_server/common/custom_clusters.py | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index b5e8d59b..8c011b4f 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -93,6 +93,9 @@ def descriptor(cls) -> ClusterObjectDescriptor: ClusterObjectFieldDescriptor( Label="valvePosition", Tag=0x130A0018, Type=int ), + ClusterObjectFieldDescriptor( + Label="motionSensitivity", Tag=0x130A000D, Type=int + ), ] ) @@ -105,6 +108,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: altitude: float32 | None = None pressure: float32 | None = None valvePosition: int | None = None + motionSensitivity: int | None = None class Attributes: """Attributes for the Eve Cluster.""" @@ -314,6 +318,29 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: int = 0 + @dataclass + class MotionSensitivity(ClusterAttributeDescriptor, CustomClusterAttributeMixin): + """MotionSensitivity Attribute within the Eve Cluster.""" + + should_poll = True + + @ChipUtility.classproperty + def cluster_id(cls) -> int: + """Return cluster id.""" + return 0x130AFC01 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + """Return attribute id.""" + return 0x130A000D + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + """Return attribute type.""" + return ClusterObjectFieldDescriptor(Type=int) + + value: int = 0 + @dataclass class NeoCluster(Cluster, CustomClusterMixin): From 51c6697973da6c0f25a39a562626162506637364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Sat, 14 Sep 2024 18:03:07 +0200 Subject: [PATCH 2/3] Update custom_clusters.py --- matter_server/common/custom_clusters.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index 8c011b4f..236a0f9f 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -319,7 +319,9 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: int = 0 @dataclass - class MotionSensitivity(ClusterAttributeDescriptor, CustomClusterAttributeMixin): + class MotionSensitivity( + ClusterAttributeDescriptor, CustomClusterAttributeMixin + ): """MotionSensitivity Attribute within the Eve Cluster.""" should_poll = True From ed59b2028fd6b6a0e7989483ea3db0d808a1e56b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 18 Sep 2024 07:47:38 +0200 Subject: [PATCH 3/3] Update custom_clusters.py Disable polling for MotionSensitivity --- matter_server/common/custom_clusters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index 236a0f9f..74fa24ff 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -324,7 +324,7 @@ class MotionSensitivity( ): """MotionSensitivity Attribute within the Eve Cluster.""" - should_poll = True + should_poll = False @ChipUtility.classproperty def cluster_id(cls) -> int: