Skip to content

Commit 1edfc69

Browse files
committed
Fix up bad quirks
1 parent 34f93a6 commit 1edfc69

File tree

6 files changed

+8
-70
lines changed

6 files changed

+8
-70
lines changed

tests/test_quirks_v2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def test_manufacturer_model_metadata_unique() -> None:
6565
)
6666

6767
for quirk in ALL_QUIRK_V2_CLASSES:
68-
if quirk.fw_version_filter is not None:
69-
# skip quirks with firmware filter, as they can share manufacturer/model
68+
if quirk.fw_version_filter is not None or quirk.filters:
69+
# skip quirks with firmware filter or general filters, as they can share manufacturer/model
7070
continue
7171
for metadata in quirk.manufacturer_model_metadata:
7272
man_model_quirk_map[(metadata.manufacturer, metadata.model)].append(

zhaquirks/centralite/cl_3300S.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
(
1212
QuirkBuilder(CENTRALITE, "3300")
13-
.applies_to(CENTRALITE, "3300-S")
13+
# .applies_to(CENTRALITE, "3300-S") # TODO: this is also defined in `ias.py`!
1414
.applies_to(CENTRALITE, "3323-G")
1515
.replaces(PowerConfigurationCluster, endpoint_id=1)
1616
.removes(PowerConfiguration.cluster_id, endpoint_id=2)

zhaquirks/centralite/cl_3305S.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
from zhaquirks import PowerConfigurationCluster
66
from zhaquirks.centralite import CENTRALITE
77

8-
# <SimpleDescriptor endpoint=1 profile=260 device_type=1026
9-
# device_version=0
10-
# input_clusters=[0, 1, 3, 1026, 1280, 32, 2821]
11-
# output_clusters=[25]>
12-
# <SimpleDescriptor endpoint=2 profile=260 device_type=263
13-
# device_version=0
14-
# input_clusters=[0, 1, 3, 1030, 2821]
15-
# output_clusters=[3]>
168
(
179
QuirkBuilder(CENTRALITE, "3305-S")
1810
.applies_to(CENTRALITE, "3305")
@@ -26,10 +18,3 @@
2618
.removes(PowerConfigurationCluster, endpoint_id=2)
2719
.add_to_registry()
2820
)
29-
30-
(
31-
QuirkBuilder(CENTRALITE, "3305")
32-
.replaces(PowerConfigurationCluster, endpoint_id=1)
33-
.skip_configuration()
34-
.add_to_registry()
35-
)

zhaquirks/ikea/shortcutbtn.py

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
SHORT_PRESS,
1919
TURN_ON,
2020
)
21-
from zhaquirks.ikea import IKEA, IKEA_CLUSTER_ID, DoublingPowerConfig1CRCluster
21+
from zhaquirks.ikea import IKEA, DoublingPowerConfig1CRCluster
2222

2323
(
2424
QuirkBuilder(IKEA, "TRADFRI SHORTCUT Button")
@@ -50,36 +50,3 @@
5050
)
5151
.add_to_registry()
5252
)
53-
54-
55-
(
56-
QuirkBuilder(IKEA, "TRADFRI SHORTCUT Button")
57-
.replaces(DoublingPowerConfig1CRCluster, endpoint_id=1)
58-
.removes(IKEA_CLUSTER_ID, endpoint_id=1)
59-
.device_automation_triggers(
60-
{
61-
(SHORT_PRESS, TURN_ON): {
62-
COMMAND: COMMAND_ON,
63-
CLUSTER_ID: 6,
64-
ENDPOINT_ID: 1,
65-
},
66-
(DOUBLE_PRESS, TURN_ON): {
67-
COMMAND: COMMAND_OFF,
68-
CLUSTER_ID: 6,
69-
ENDPOINT_ID: 1,
70-
},
71-
(LONG_PRESS, DIM_UP): {
72-
COMMAND: COMMAND_MOVE_ON_OFF,
73-
CLUSTER_ID: 8,
74-
ENDPOINT_ID: 1,
75-
PARAMS: {"move_mode": 0},
76-
},
77-
(LONG_RELEASE, DIM_UP): {
78-
COMMAND: COMMAND_STOP_ON_OFF,
79-
CLUSTER_ID: 8,
80-
ENDPOINT_ID: 1,
81-
},
82-
}
83-
)
84-
.add_to_registry()
85-
)

zhaquirks/ikea/twobtnremote.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from zigpy.quirks.v2 import QuirkBuilder
44
from zigpy.zcl.clusters.closures import WindowCovering
5-
from zigpy.zcl.clusters.general import Groups
65

76
from zhaquirks.const import (
87
CLUSTER_ID,
@@ -54,6 +53,9 @@
5453

5554
(
5655
QuirkBuilder(IKEA, "TRADFRI on/off switch")
56+
.filter(
57+
lambda device: WindowCovering.cluster_id not in device.endpoints[1].in_clusters
58+
)
5759
.replaces(DoublingPowerConfig1CRCluster, endpoint_id=1)
5860
.device_automation_triggers(_DEVICE_AUTOMATION_TRIGGERS)
5961
.add_to_registry()
@@ -63,6 +65,7 @@
6365
# ZLL profile variant
6466
(
6567
QuirkBuilder(IKEA, "TRADFRI on/off switch")
68+
.filter(lambda device: WindowCovering.cluster_id in device.endpoints[1].in_clusters)
6669
.replaces(DoublingPowerConfig1CRCluster, endpoint_id=1)
6770
.removes(WindowCovering.cluster_id, endpoint_id=1)
6871
.device_automation_triggers(_DEVICE_AUTOMATION_TRIGGERS)
@@ -76,13 +79,3 @@
7679
.device_automation_triggers(_DEVICE_AUTOMATION_TRIGGERS)
7780
.add_to_registry()
7881
)
79-
80-
81-
(
82-
QuirkBuilder(IKEA, "RODRET Dimmer")
83-
.applies_to(IKEA, "RODRET wireless dimmer")
84-
.replaces(PowerConfig1AAACluster, endpoint_id=1)
85-
.removes(Groups.cluster_id, endpoint_id=1)
86-
.device_automation_triggers(_DEVICE_AUTOMATION_TRIGGERS)
87-
.add_to_registry()
88-
)

zhaquirks/thirdreality/switch.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,3 @@ class CustomPowerConfigurationCluster(PowerConfigurationCluster):
1919
.replaces(CustomPowerConfigurationCluster, endpoint_id=1)
2020
.add_to_registry()
2121
)
22-
23-
24-
(
25-
QuirkBuilder(THIRD_REALITY, "3RSS008Z")
26-
.replaces(CustomPowerConfigurationCluster, endpoint_id=1)
27-
.add_to_registry()
28-
)

0 commit comments

Comments
 (0)