Skip to content

Commit

Permalink
Add Philips Hue wall switch RDM004 variant (#3075)
Browse files Browse the repository at this point in the history
Co-authored-by: TheJulianJES <[email protected]>
  • Loading branch information
aradar and TheJulianJES authored Oct 16, 2024
1 parent d84d94f commit 700d83b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
12 changes: 6 additions & 6 deletions tests/test_philips.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
)
import zhaquirks.philips
from zhaquirks.philips import Button, ButtonPressQueue, PhilipsRemoteCluster, PressType
from zhaquirks.philips.rdm001 import PhilipsRDM001
from zhaquirks.philips.rdm002 import PhilipsRDM002
from zhaquirks.philips.rom001 import PhilipsROM001
from zhaquirks.philips.rwl022 import PhilipsRWL022
from zhaquirks.philips.rwlfirstgen import PhilipsRWLFirstGen, PhilipsRWLFirstGen2
from zhaquirks.philips.wall_switch import PhilipsWallSwitch

zhaquirks.setup()

Expand Down Expand Up @@ -95,7 +95,7 @@
},
),
(
[PhilipsRDM001],
[PhilipsWallSwitch],
{
(SHORT_PRESS, TURN_ON): {COMMAND: "left_press"},
(LONG_PRESS, TURN_ON): {COMMAND: "left_hold"},
Expand Down Expand Up @@ -331,7 +331,7 @@ def press(self, callback, button):
"dev, ep, button, events",
(
(
PhilipsRDM001,
PhilipsWallSwitch,
1,
"left",
["press", "short_release"],
Expand Down Expand Up @@ -415,7 +415,7 @@ def test_PhilipsRemoteCluster_short_press(
"on",
),
(
PhilipsRDM001,
PhilipsWallSwitch,
1,
"left",
),
Expand Down Expand Up @@ -490,7 +490,7 @@ def test_PhilipsRemoteCluster_multi_press(
@pytest.mark.parametrize(
"dev, ep",
(
(PhilipsRDM001, 1),
(PhilipsWallSwitch, 1),
(PhilipsROM001, 1),
(PhilipsRWLFirstGen, 2),
(PhilipsRWLFirstGen2, 2),
Expand All @@ -516,7 +516,7 @@ def test_PhilipsRemoteCluster_ignore_unknown_buttons(zigpy_device_from_quirk, de
(
(PhilipsROM001, 1, "on", "hold", "long_release", "hold_release"),
(
PhilipsRDM001,
PhilipsWallSwitch,
1,
"left",
"hold",
Expand Down
13 changes: 9 additions & 4 deletions zhaquirks/philips/rdm001.py → zhaquirks/philips/wall_switch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Signify RDM001 device."""
"""Signify wall switch devices (RDM001 and RDM004)."""

from zigpy.profiles import zha
from zigpy.quirks import CustomCluster, CustomDevice
Expand Down Expand Up @@ -72,15 +72,20 @@ class PhilipsRdm001RemoteCluster(PhilipsRemoteCluster):
]


class PhilipsRDM001(CustomDevice):
"""Philips RDM001 device."""
class PhilipsWallSwitch(CustomDevice):
"""Philips RDM001 or RDM004 device."""

signature = {
# <SimpleDescriptor endpoint=1 profile=260 device_type=2080
# device_version=1
# input_clusters=[0, 1, 3, 64512]
# output_clusters=[3, 4, 6, 8, 25]>
MODELS_INFO: [(PHILIPS, "RDM001"), (SIGNIFY, "RDM001")],
MODELS_INFO: [
(PHILIPS, "RDM001"),
(SIGNIFY, "RDM001"),
(PHILIPS, "RDM004"), # likely not needed
(SIGNIFY, "RDM004"),
],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
Expand Down

0 comments on commit 700d83b

Please sign in to comment.