diff --git a/zhaquirks/philips/__init__.py b/zhaquirks/philips/__init__.py index 6b8b2dfdda..9bad0f0ee7 100644 --- a/zhaquirks/philips/__init__.py +++ b/zhaquirks/philips/__init__.py @@ -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, @@ -340,3 +345,21 @@ class PhilipsRwlRemoteCluster(PhilipsRemoteCluster): 3: Button("down", DIM_DOWN), 4: Button("off", TURN_OFF), } + + +class PhilipsHueLightCluster(CustomCluster): + """Philips Hue manufacturer cluster.""" + + cluster_id: Final[t.uint16_t] = 0xFC03 + ep_attribute: Final[str] = "philips_hue_light_cluster" + name: Final[str] = "PhilipsHueLightCluster" + + class ServerCommandDefs(BaseCommandDefs): + """Server command definitions.""" + + multicolor: Final = ZCLCommandDef( + id=0x00, + schema={"data": t.SerializableBytes}, + direction=Direction.Client_to_Server, + is_manufacturer_specific=True, + ) diff --git a/zhaquirks/philips/hue_light.py b/zhaquirks/philips/hue_light.py new file mode 100644 index 0000000000..8e4b01605d --- /dev/null +++ b/zhaquirks/philips/hue_light.py @@ -0,0 +1,134 @@ +"""Philips Hue devices.""" + +from zigpy.quirks.v2 import QuirkBuilder + +from zhaquirks.philips import PHILIPS, SIGNIFY, PhilipsHueLightCluster + +( + 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(PhilipsHueLightCluster, 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(PhilipsHueLightCluster, endpoint_id=11) + .add_to_registry() +) + +( + QuirkBuilder() + .applies_to(SIGNIFY, "LTB003") + .friendly_name( + model="Hue White Ambiance BR30 E26", + manufacturer="Philips", + ) + .replaces(PhilipsHueLightCluster, 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(PhilipsHueLightCluster, 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(PhilipsHueLightCluster, 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(PhilipsHueLightCluster, 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(PhilipsHueLightCluster, 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(PhilipsHueLightCluster, endpoint_id=11) + .add_to_registry() +) + +( + QuirkBuilder() + .applies_to(PHILIPS, "7602031P7") + .applies_to(PHILIPS, "7602031U7") + .friendly_name( + model="Hue Go", + manufacturer="Philips", + ) + .replaces(PhilipsHueLightCluster, endpoint_id=11) + .add_to_registry() +) diff --git a/zhaquirks/philips/soc001.py b/zhaquirks/philips/soc001.py index 3a7bd8444f..87cf58e6ea 100644 --- a/zhaquirks/philips/soc001.py +++ b/zhaquirks/philips/soc001.py @@ -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.""" @@ -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",