Skip to content

Commit

Permalink
Add alternative quirk for IKEA E1812 button (#1462)
Browse files Browse the repository at this point in the history
* Add alternative quirk for IKEA E1812 button

Some of these buttons seem to expose the IKEA manufacturer-specific
cluster, but are lacking the WindowCovering cluster. This second
configuration caused the original quirk to not match.

* whitespace cleanup

Co-authored-by: RenWal <rene@hiddenasian.dev>
  • Loading branch information
RenWal and RenWal committed Apr 7, 2022
1 parent d2dcc4a commit b2c98db
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions zhaquirks/ikea/shortcutbtn.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,79 @@ class IkeaTradfriShortcutBtn(CustomDevice):
ENDPOINT_ID: 1,
},
}


class IkeaTradfriShortcutBtn2(CustomDevice):
"""Custom device representing IKEA of Sweden TRADFRI shortcut button with IKEA cluster."""

signature = {
# <SimpleDescriptor endpoint=1 profile=260 device_type=2080
# device_version=1
# input_clusters=[0, 1, 3, 9, 32, 4096, 64636]
# output_clusters=[3, 4, 6, 8, 25, 4096]>
MODELS_INFO: [(IKEA, "TRADFRI SHORTCUT Button")],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.NON_COLOR_CONTROLLER,
INPUT_CLUSTERS: [
Basic.cluster_id,
PowerConfiguration.cluster_id,
Identify.cluster_id,
Alarms.cluster_id,
PollControl.cluster_id,
LightLink.cluster_id,
0xFC7C, # IKEA Cluster
],
OUTPUT_CLUSTERS: [
Identify.cluster_id,
Groups.cluster_id,
OnOff.cluster_id,
LevelControl.cluster_id,
Ota.cluster_id,
LightLink.cluster_id,
],
}
},
}

replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.NON_COLOR_CONTROLLER,
INPUT_CLUSTERS: [
Basic.cluster_id,
PowerConfiguration1CRCluster,
Identify.cluster_id,
Alarms.cluster_id,
PollControl.cluster_id,
LightLinkCluster,
],
OUTPUT_CLUSTERS: [
Identify.cluster_id,
Groups.cluster_id,
OnOff.cluster_id,
LevelControl.cluster_id,
Ota.cluster_id,
LightLink.cluster_id,
],
}
}
}

device_automation_triggers = {
(SHORT_PRESS, TURN_ON): {COMMAND: COMMAND_ON, CLUSTER_ID: 6, ENDPOINT_ID: 1},
(DOUBLE_PRESS, TURN_ON): {COMMAND: COMMAND_OFF, CLUSTER_ID: 6, ENDPOINT_ID: 1},
(LONG_PRESS, DIM_UP): {
COMMAND: COMMAND_MOVE_ON_OFF,
CLUSTER_ID: 8,
ENDPOINT_ID: 1,
ARGS: [0, 83],
},
(LONG_RELEASE, DIM_UP): {
COMMAND: COMMAND_STOP,
CLUSTER_ID: 8,
ENDPOINT_ID: 1,
},
}

0 comments on commit b2c98db

Please sign in to comment.