From cfd1f15617db7803ff93e07dbe1aa6a1933585a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Mon, 12 Aug 2024 17:30:09 +0200 Subject: [PATCH 01/12] Update custom_clusters.py --- matter_server/common/custom_clusters.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index 58237468..431bc24d 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -99,6 +99,8 @@ def descriptor(cls) -> ClusterObjectDescriptor: wattAccumulatedControlPoint: float32 | None = None voltage: float32 | None = None current: float32 | None = None + altitude: int | None = None + pressure: float32 | None = None class Attributes: """Attributes for the Eve Cluster.""" From 945b6c27794f1224925eef94576764ec3a7d0279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Mon, 12 Aug 2024 17:34:19 +0200 Subject: [PATCH 02/12] Update custom_clusters.py --- matter_server/common/custom_clusters.py | 45 +++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index 431bc24d..2f62d1b4 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -245,6 +245,51 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: float32 = 0 + @dataclass + class Altitude(ClusterAttributeDescriptor, CustomClusterAttributeMixin): + """Altitude 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 0x130A0013 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + """Return attribute type.""" + return ClusterObjectFieldDescriptor(Type=int) + + value: int = 0 + + @dataclass + class Pressure(ClusterAttributeDescriptor, CustomClusterAttributeMixin): + """Pressure 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 0x130A0014 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + """Return attribute type.""" + return ClusterObjectFieldDescriptor(Type=int) + + value: int = 0 @dataclass class NeoCluster(Cluster, CustomClusterMixin): From 7ba2869e4aa68db71bdf46ae4fd41cc284a7d4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Mon, 12 Aug 2024 17:41:24 +0200 Subject: [PATCH 03/12] Update custom_clusters.py Ruff --- matter_server/common/custom_clusters.py | 1 + 1 file changed, 1 insertion(+) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index 2f62d1b4..83d000e0 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -291,6 +291,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: int = 0 + @dataclass class NeoCluster(Cluster, CustomClusterMixin): """Custom (vendor-specific) cluster for Neo - Vendor ID 4991 (0x137F).""" From c6c45d09e7b666e8795598df2884310b18cc2dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Tue, 13 Aug 2024 08:11:24 +0200 Subject: [PATCH 04/12] Update custom_clusters.py altitude attribute doesn't change so no need to be polled --- matter_server/common/custom_clusters.py | 26 +------------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index 83d000e0..9e247857 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -99,7 +99,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: wattAccumulatedControlPoint: float32 | None = None voltage: float32 | None = None current: float32 | None = None - altitude: int | None = None pressure: float32 | None = None class Attributes: @@ -245,29 +244,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: float32 = 0 - @dataclass - class Altitude(ClusterAttributeDescriptor, CustomClusterAttributeMixin): - """Altitude 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 0x130A0013 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - """Return attribute type.""" - return ClusterObjectFieldDescriptor(Type=int) - - value: int = 0 - @dataclass class Pressure(ClusterAttributeDescriptor, CustomClusterAttributeMixin): """Pressure Attribute within the Eve Cluster.""" @@ -289,7 +265,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: """Return attribute type.""" return ClusterObjectFieldDescriptor(Type=int) - value: int = 0 + value: float32 = 0 @dataclass From b8f102b31aede5ba1a1b573d32be57254f6ebc60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Tue, 13 Aug 2024 08:13:32 +0200 Subject: [PATCH 05/12] Update custom_clusters.py Fix attribute type --- 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 9e247857..c8ab73f7 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -263,7 +263,7 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: """Return attribute type.""" - return ClusterObjectFieldDescriptor(Type=int) + return ClusterObjectFieldDescriptor(Type=float32) value: float32 = 0 From 95b6f45b96cf71ca982fe316e84016fcf35f2f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Tue, 13 Aug 2024 10:58:45 +0200 Subject: [PATCH 06/12] Update custom_clusters.py Altitude attribute --- matter_server/common/custom_clusters.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index c8ab73f7..7edb81e7 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -99,6 +99,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: wattAccumulatedControlPoint: float32 | None = None voltage: float32 | None = None current: float32 | None = None + altitude: int | None = None pressure: float32 | None = None class Attributes: @@ -244,6 +245,29 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: float32 = 0 + @dataclass + class Altitude(ClusterAttributeDescriptor, CustomClusterAttributeMixin): + """Altitude Attribute within the Eve Cluster.""" + + should_poll = False + + @ChipUtility.classproperty + def cluster_id(cls) -> int: + """Return cluster id.""" + return 0x130AFC01 + + @ChipUtility.classproperty + def attribute_id(cls) -> int: + """Return attribute id.""" + return 0x130A0013 + + @ChipUtility.classproperty + def attribute_type(cls) -> ClusterObjectFieldDescriptor: + """Return attribute type.""" + return ClusterObjectFieldDescriptor(Type=int) + + value: int = 0 + @dataclass class Pressure(ClusterAttributeDescriptor, CustomClusterAttributeMixin): """Pressure Attribute within the Eve Cluster.""" From 717167a8a98e2068467b6cf93279ca94cd2f0efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Fri, 16 Aug 2024 14:57:01 +0200 Subject: [PATCH 07/12] Update matter_server/common/custom_clusters.py Co-authored-by: Stefan Agner --- matter_server/common/custom_clusters.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index 7edb81e7..45e66a57 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -272,8 +272,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Pressure(ClusterAttributeDescriptor, CustomClusterAttributeMixin): """Pressure Attribute within the Eve Cluster.""" - should_poll = True - @ChipUtility.classproperty def cluster_id(cls) -> int: """Return cluster id.""" From 9783cb64382978a8939a2bc106ae0974e49abdb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Fri, 16 Aug 2024 15:27:33 +0200 Subject: [PATCH 08/12] Update matter_server/common/custom_clusters.py Co-authored-by: Stefan Agner --- 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 45e66a57..e3a324b7 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -99,7 +99,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: wattAccumulatedControlPoint: float32 | None = None voltage: float32 | None = None current: float32 | None = None - altitude: int | None = None + altitude: float32 | None = None pressure: float32 | None = None class Attributes: From e135b69b1e7cc066de61628d602c25eecbd57151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Fri, 16 Aug 2024 15:27:54 +0200 Subject: [PATCH 09/12] Update matter_server/common/custom_clusters.py Co-authored-by: Stefan Agner --- 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 e3a324b7..279b5eec 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -266,7 +266,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: """Return attribute type.""" return ClusterObjectFieldDescriptor(Type=int) - value: int = 0 + value: float32 = 0 @dataclass class Pressure(ClusterAttributeDescriptor, CustomClusterAttributeMixin): From 1e166ff89097d19c6a591cad309acf48620bb785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Fri, 16 Aug 2024 15:28:59 +0200 Subject: [PATCH 10/12] Update matter_server/common/custom_clusters.py Co-authored-by: Stefan Agner --- 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 279b5eec..f7c607fa 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -264,7 +264,7 @@ def attribute_id(cls) -> int: @ChipUtility.classproperty def attribute_type(cls) -> ClusterObjectFieldDescriptor: """Return attribute type.""" - return ClusterObjectFieldDescriptor(Type=int) + return ClusterObjectFieldDescriptor(Type=float32) value: float32 = 0 From 5d5ec709d91de8b75cbcc825c18950ac6efa24e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Fri, 16 Aug 2024 15:32:15 +0200 Subject: [PATCH 11/12] Update custom_clusters.py Set altitude to float --- 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 f7c607fa..1d48773e 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -85,7 +85,7 @@ def descriptor(cls) -> ClusterObjectDescriptor: Label="current", Tag=0x130A0009, Type=float32 ), ClusterObjectFieldDescriptor( - Label="altitude", Tag=0x130A0013, Type=int + Label="altitude", Tag=0x130A0013, Type=float32 ), ClusterObjectFieldDescriptor( Label="pressure", Tag=0x130A0014, Type=float32 From 0e2f0eb06734905fe2e4c373e32e9e91a3f1e3d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Fri, 16 Aug 2024 15:56:11 +0200 Subject: [PATCH 12/12] Update matter_server/common/custom_clusters.py Co-authored-by: Stefan Agner --- matter_server/common/custom_clusters.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/matter_server/common/custom_clusters.py b/matter_server/common/custom_clusters.py index 1d48773e..38762f6e 100644 --- a/matter_server/common/custom_clusters.py +++ b/matter_server/common/custom_clusters.py @@ -249,8 +249,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: class Altitude(ClusterAttributeDescriptor, CustomClusterAttributeMixin): """Altitude Attribute within the Eve Cluster.""" - should_poll = False - @ChipUtility.classproperty def cluster_id(cls) -> int: """Return cluster id."""