Skip to content
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
4 changes: 1 addition & 3 deletions zhaquirks/ikea/plug.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
"""IKEA TRADFRI and TRETAKT plugs quirk."""
"""IKEA TRADFRI plugs quirk."""

from zigpy.quirks.v2 import QuirkBuilder
from zigpy.zcl.clusters.general import LevelControl

from zhaquirks.ikea import IKEA

# remove LevelControl for plug to not show config options in ZHA
# TRETAKT likely also has Child Lock and LED control, see INSPELNING
(
QuirkBuilder(IKEA, "TRADFRI control outlet")
.also_applies_to(IKEA, "TRETAKT Smart plug")
.removes(LevelControl.cluster_id)
.add_to_registry()
)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""IKEA INSPELNING plug quirk."""
"""IKEA INSPELNING and TRETAKT plug quirk."""

from zigpy.quirks.v2 import CustomCluster, QuirkBuilder
import zigpy.types as t
Expand Down Expand Up @@ -29,6 +29,7 @@ class AttributeDefs(BaseAttributeDefs):
# remove LevelControl for plugs to not show config options in ZHA
(
QuirkBuilder(IKEA, "INSPELNING Smart plug")
.applies_to(IKEA, "TRETAKT Smart plug")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Note: also_applies_to is the same as applies_to. The different naming is due to quirk builders being allowed to be created without any manufacturer/model info now, so the "also" doesn't make sense in those case.

Doesn't really matter. They're both the same for now.

.removes(LevelControl.cluster_id)
.replaces(IkeaSmartPlugCluster)
.switch(
Expand Down
Loading