Skip to content

Commit

Permalink
Update custom_clusters.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lboue committed Aug 12, 2024
1 parent cfd1f15 commit 945b6c2
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions matter_server/common/custom_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 945b6c2

Please sign in to comment.