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

Add Philips Hue wall switch RDM004 variant #3075

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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