Skip to content

Commit

Permalink
Add IKEA Rodret dimmer support (zigpy#2609)
Browse files Browse the repository at this point in the history
* Update twobtnremote.py

Add support for Rodret dimmers

* Update twobtnremote.py

Make comment match

* feedback in pullrequest related to adding Rodret

* no need to double power

* Undo unrelated non-doubling change for two button remote

* Add `PowerConfig1AAACluster` for Rodret

---------

Co-authored-by: TheJulianJES <[email protected]>
  • Loading branch information
2 people authored and elupus committed Jan 17, 2024
1 parent 173901c commit 1cb8a95
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 1 deletion.
10 changes: 10 additions & 0 deletions zhaquirks/ikea/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,16 @@ class ShortcutV2Cluster(EventableCluster):


# ZCL compliant IKEA power configuration clusters:
class PowerConfig1AAACluster(CustomCluster, PowerConfiguration):
"""Updating power attributes: 2 AAA."""

_CONSTANT_ATTRIBUTES = {
BATTERY_SIZE: 4,
BATTERY_QUANTITY: 1,
BATTERY_RATED_VOLTAGE: 15,
}


class PowerConfig2AAACluster(CustomCluster, PowerConfiguration):
"""Updating power attributes: 2 AAA."""

Expand Down
68 changes: 67 additions & 1 deletion zhaquirks/ikea/twobtnremote.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@
TURN_OFF,
TURN_ON,
)
from zhaquirks.ikea import IKEA, IKEA_CLUSTER_ID, DoublingPowerConfig1CRCluster
from zhaquirks.ikea import (
IKEA,
IKEA_CLUSTER_ID,
DoublingPowerConfig1CRCluster,
PowerConfig1AAACluster,
)


class IkeaTradfriRemote2Btn(CustomDevice):
Expand Down Expand Up @@ -195,3 +200,64 @@ class IkeaTradfriRemote2BtnZLL(CustomDevice):
}

device_automation_triggers = IkeaTradfriRemote2Btn.device_automation_triggers.copy()


class IkeaRodretRemote2Btn(CustomDevice):
"""Custom device representing IKEA of Sweden RODRET remote control."""

signature = {
# <SimpleDescriptor endpoint=1 profile=260 device_type=2080
# device_version=1
# input_clusters=[0, 1, 3, 32, 4096, 64636]
# output_clusters=[3, 4, 6, 8, 258, 4096]>
MODELS_INFO: [(IKEA, "RODRET Dimmer")],
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,
PollControl.cluster_id,
LightLink.cluster_id,
IKEA_CLUSTER_ID,
],
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,
PowerConfig1AAACluster,
Identify.cluster_id,
PollControl.cluster_id,
LightLink.cluster_id,
IKEA_CLUSTER_ID,
],
OUTPUT_CLUSTERS: [
Identify.cluster_id,
Groups.cluster_id,
OnOff.cluster_id,
LevelControl.cluster_id,
Ota.cluster_id,
LightLink.cluster_id,
],
}
}
}

device_automation_triggers = IkeaTradfriRemote2Btn.device_automation_triggers.copy()

0 comments on commit 1cb8a95

Please sign in to comment.