Skip to content

Commit

Permalink
Bind and set up reporting for Hue contact sensor (#238)
Browse files Browse the repository at this point in the history
Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
  • Loading branch information
mguaylam and TheJulianJES authored Oct 26, 2024
1 parent 593d33c commit 636ad13
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions zha/zigbee/cluster_handlers/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
IKEA_REMOTE_CLUSTER: Final[int] = 0xFC80
INOVELLI_CLUSTER: Final[int] = 0xFC31
OSRAM_BUTTON_CLUSTER: Final[int] = 0xFD00
PHILIPS_CONTACT_CLUSTER: Final[int] = 0xFC06
PHILLIPS_REMOTE_CLUSTER: Final[int] = 0xFC00
SMARTTHINGS_ACCELERATION_CLUSTER: Final[int] = 0xFC02
SMARTTHINGS_HUMIDITY_CLUSTER: Final[int] = 0xFC45
Expand Down
12 changes: 12 additions & 0 deletions zha/zigbee/cluster_handlers/manufacturerspecific.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
IKEA_REMOTE_CLUSTER,
INOVELLI_CLUSTER,
OSRAM_BUTTON_CLUSTER,
PHILIPS_CONTACT_CLUSTER,
PHILLIPS_REMOTE_CLUSTER,
REPORT_CONFIG_ASAP,
REPORT_CONFIG_DEFAULT,
Expand Down Expand Up @@ -78,6 +79,17 @@ class OsramButtonClusterHandler(ClusterHandler):
REPORT_CONFIG = ()


@registries.CLUSTER_HANDLER_ONLY_CLUSTERS.register(PHILIPS_CONTACT_CLUSTER)
@registries.CLUSTER_HANDLER_REGISTRY.register(PHILIPS_CONTACT_CLUSTER)
class PhillipsContactClusterHandler(ClusterHandler):
"""Phillips contact cluster handler."""

REPORT_CONFIG = (
AttrReportConfig(attr="contact", config=REPORT_CONFIG_IMMEDIATE),
AttrReportConfig(attr="tamper", config=REPORT_CONFIG_IMMEDIATE),
)


@registries.CLUSTER_HANDLER_ONLY_CLUSTERS.register(PHILLIPS_REMOTE_CLUSTER)
@registries.CLUSTER_HANDLER_REGISTRY.register(PHILLIPS_REMOTE_CLUSTER)
class PhillipsRemoteClusterHandler(ClusterHandler):
Expand Down

0 comments on commit 636ad13

Please sign in to comment.