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

Implement contact attribute and skip on/off configuration for Philips SOC001 #3464

Closed
wants to merge 4 commits into from
Closed
Changes from 3 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
33 changes: 31 additions & 2 deletions zhaquirks/philips/soc001.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,27 @@

from zigpy import types
from zigpy.quirks import CustomCluster
from zigpy.quirks.v2 import BinarySensorDeviceClass, EntityType, QuirkBuilder
from zigpy.quirks.v2 import (
BinarySensorDeviceClass,
ClusterType,
EntityType,
QuirkBuilder,
)
from zigpy.zcl.clusters.general import OnOff
from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef


class PhilipsOnOffCluster(CustomCluster, OnOff):
"""Philips OnOff cluster for contact sensor."""

"""Prevents the creation of the on_off entity."""

cluster_id = 6 # 0x0006
name = "Philips OnOff cluster"
ep_attribute = "philips_onoff_cluster"
SKIP_CONFIGURATION = True


class PhilipsContactCluster(CustomCluster):
"""Philips manufacturer specific cluster for contact sensor."""

Expand Down Expand Up @@ -44,14 +61,26 @@ class AttributeDefs(BaseAttributeDefs):
# input_clusters=[0, 1, 3, 64518]
# output_clusters=[0, 3, 6, 25]>
QuirkBuilder("Signify Netherlands B.V.", "SOC001")
.replaces(
PhilipsOnOffCluster,
cluster_type=ClusterType.Client,
endpoint_id=2,
)
.replaces(PhilipsContactCluster, endpoint_id=2)
.binary_sensor(
"contact",
PhilipsContactCluster.cluster_id,
endpoint_id=2,
device_class=BinarySensorDeviceClass.OPENING,
EntityType=EntityType.STANDARD,
mguaylam marked this conversation as resolved.
Show resolved Hide resolved
fallback_name="Contact",
)
.binary_sensor(
"tamper",
PhilipsContactCluster.cluster_id,
endpoint_id=2,
device_class=BinarySensorDeviceClass.TAMPER,
entity_type=EntityType.DIAGNOSTIC,
translation_key="tamper",
fallback_name="Tamper",
)
.add_to_registry()
Expand Down
Loading