Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 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
25 changes: 24 additions & 1 deletion zhaquirks/philips/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import Basic
from zigpy.zcl.clusters.measurement import OccupancySensing
from zigpy.zcl.foundation import ZCLAttributeDef
from zigpy.zcl.foundation import (
BaseCommandDefs,
Direction,
ZCLAttributeDef,
ZCLCommandDef,
)

from zhaquirks.const import (
ARGS,
Expand Down Expand Up @@ -340,3 +345,21 @@ class PhilipsRwlRemoteCluster(PhilipsRemoteCluster):
3: Button("down", DIM_DOWN),
4: Button("off", TURN_OFF),
}


class PhilipsHueCluster(CustomCluster):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would renaming this to PhilipsLightCluster or PhilipsHueLightCluster make sense?

"""Philips Hue manufacturer cluster."""

cluster_id: Final[t.uint16_t] = 0xFC03
ep_attribute: Final[str] = "philips_hue_cluster"
name: Final[str] = "PhilipsHueCluster"

class ServerCommandDefs(BaseCommandDefs):
"""Server command definitions."""

multicolor: Final = ZCLCommandDef(
id=0x00,
schema={"data": t.SerializableBytes},
direction=Direction.Client_to_Server,
is_manufacturer_specific=True,
)
134 changes: 134 additions & 0 deletions zhaquirks/philips/hue.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
"""Philips Hue devices."""

from zigpy.quirks.v2 import QuirkBuilder

from zhaquirks.philips import PHILIPS, SIGNIFY, PhilipsHueCluster

(
QuirkBuilder()
.applies_to(SIGNIFY, "LCX001")
.applies_to(SIGNIFY, "LCX002")
.applies_to(SIGNIFY, "LCX003")
.applies_to(SIGNIFY, "LCX005")
.applies_to(SIGNIFY, "LCX006")
.friendly_name(
model="Hue Play Gradient Lightstrip",
manufacturer="Philips",
)
.replaces(PhilipsHueCluster, endpoint_id=11)
.add_to_registry()
)

(
QuirkBuilder()
.applies_to(SIGNIFY, "LCX012")
.applies_to(SIGNIFY, "LCX015")
.applies_to(SIGNIFY, "LCX016")
.applies_to(SIGNIFY, "LCX017")
.friendly_name(
model="Hue Festavia Gradient Light String",
manufacturer="Philips",
)
.replaces(PhilipsHueCluster, endpoint_id=11)
.add_to_registry()
)

(
QuirkBuilder()
.applies_to(SIGNIFY, "LTB003")
.friendly_name(
model="Hue White Ambiance BR30 E26",
manufacturer="Philips",
)
.replaces(PhilipsHueCluster, endpoint_id=11)
.add_to_registry()
)

(
QuirkBuilder()
.applies_to(SIGNIFY, "929003116301")
.applies_to(SIGNIFY, "929003116401")
.applies_to(SIGNIFY, "929003116501")
.applies_to(SIGNIFY, "929003116601")
.friendly_name(
model="Hue Perifo Light Tube",
manufacturer="Philips",
)
.replaces(PhilipsHueCluster, endpoint_id=11)
.add_to_registry()
)

(
QuirkBuilder()
.applies_to(SIGNIFY, "4080248U9")
.applies_to(SIGNIFY, "915005987101")
.applies_to(SIGNIFY, "915005987201")
.applies_to(SIGNIFY, "915005987501")
.applies_to(SIGNIFY, "915005987601")
.applies_to(SIGNIFY, "915005987701")
.applies_to(SIGNIFY, "915005987801")
.applies_to(SIGNIFY, "929003479601")
.applies_to(SIGNIFY, "929003479701")
.friendly_name(
model="Hue Signe Gradient Floor Lamp",
manufacturer="Philips",
)
.replaces(PhilipsHueCluster, endpoint_id=11)
.add_to_registry()
)

(
QuirkBuilder()
.applies_to(SIGNIFY, "915005986901")
.applies_to(SIGNIFY, "915005987001")
.applies_to(SIGNIFY, "915005987401")
.applies_to(SIGNIFY, "915005987301")
.friendly_name(
model="Hue Signe Gradient Table Lamp",
manufacturer="Philips",
)
.replaces(PhilipsHueCluster, endpoint_id=11)
.add_to_registry()
)

(
QuirkBuilder()
.applies_to(SIGNIFY, "915005987901")
.applies_to(SIGNIFY, "915005988001")
.applies_to(SIGNIFY, "915005988101")
.applies_to(SIGNIFY, "915005988201")
.applies_to(SIGNIFY, "915005988401")
.applies_to(SIGNIFY, "915005988501")
.friendly_name(
model="Hue Play Gradient Light Tube",
manufacturer="Philips",
)
.replaces(PhilipsHueCluster, endpoint_id=11)
.add_to_registry()
)

(
QuirkBuilder()
.applies_to(SIGNIFY, "929003116301")
.applies_to(SIGNIFY, "929003116401")
.applies_to(SIGNIFY, "929003116501")
.applies_to(SIGNIFY, "929003116601")
.friendly_name(
model="Hue Perifo Light Tube",
manufacturer="Philips",
)
.replaces(PhilipsHueCluster, endpoint_id=11)
.add_to_registry()
)

(
QuirkBuilder()
.applies_to(PHILIPS, "7602031P7")
.applies_to(PHILIPS, "7602031U7")
.friendly_name(
model="Hue Go",
manufacturer="Philips",
)
.replaces(PhilipsHueCluster, endpoint_id=11)
.add_to_registry()
)
4 changes: 3 additions & 1 deletion zhaquirks/philips/soc001.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from zigpy.zcl.clusters.general import OnOff
from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef

from zhaquirks.philips import SIGNIFY


class PhilipsContactCluster(CustomCluster):
"""Philips manufacturer specific cluster for contact sensor."""
Expand Down Expand Up @@ -60,7 +62,7 @@ def _update_attribute(self, attrid, value):
# device_version=0
# input_clusters=[0, 1, 3, 64518]
# output_clusters=[0, 3, 6, 25]>
QuirkBuilder("Signify Netherlands B.V.", "SOC001")
QuirkBuilder(SIGNIFY, "SOC001")
.replaces(PhilipsContactCluster, endpoint_id=2)
.binary_sensor(
"tamper",
Expand Down
Loading