Skip to content

Commit

Permalink
Update custom_clusters.py
Browse files Browse the repository at this point in the history
altitude attribute doesn't change so no need to be polled
  • Loading branch information
lboue committed Aug 13, 2024
1 parent 7ba2869 commit c6c45d0
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions matter_server/common/custom_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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."""
Expand All @@ -289,7 +265,7 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor:
"""Return attribute type."""
return ClusterObjectFieldDescriptor(Type=int)

value: int = 0
value: float32 = 0


@dataclass
Expand Down

0 comments on commit c6c45d0

Please sign in to comment.