Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MotionSensitivity attribute within the Eve Cluster #887

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions matter_server/common/custom_clusters.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ def descriptor(cls) -> ClusterObjectDescriptor:
ClusterObjectFieldDescriptor(
Label="valvePosition", Tag=0x130A0018, Type=int
),
ClusterObjectFieldDescriptor(
Label="motionSensitivity", Tag=0x130A000D, Type=int
),
]
)

Expand All @@ -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."""
Expand Down Expand Up @@ -314,6 +318,31 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor:

value: int = 0

@dataclass
class MotionSensitivity(
ClusterAttributeDescriptor, CustomClusterAttributeMixin
):
"""MotionSensitivity Attribute within the Eve Cluster."""

should_poll = True
lboue marked this conversation as resolved.
Show resolved Hide resolved

@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):
Expand Down
Loading