forked from zigpy/zha-device-handlers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inspired by zigpy#3362
- Loading branch information
Showing
1 changed file
with
126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
"""Quirk for EcoDim 05 two gang dimmer (e.g. HZC Smart Double Dimmer D686-ZG).""" | ||
|
||
from zigpy.profiles import zgp, zha | ||
from zigpy.quirks import CustomCluster, CustomDevice | ||
from zigpy.zcl.clusters.general import ( | ||
Basic, | ||
GreenPowerProxy, | ||
Groups, | ||
Identify, | ||
LevelControl, | ||
OnOff, | ||
Ota, | ||
Scenes, | ||
) | ||
from zigpy.zcl.clusters.lightlink import LightLink | ||
|
||
from zhaquirks import NoReplyMixin | ||
from zhaquirks.const import ( | ||
DEVICE_TYPE, | ||
ENDPOINTS, | ||
INPUT_CLUSTERS, | ||
MODELS_INFO, | ||
OUTPUT_CLUSTERS, | ||
PROFILE_ID, | ||
) | ||
|
||
|
||
class HzcOnOff(NoReplyMixin, CustomCluster, OnOff): | ||
"""HZC On Off Cluster.""" | ||
|
||
void_input_commands = {cmd.id for cmd in OnOff.commands_by_name.values()} | ||
|
||
|
||
class DimmerSwitch(CustomDevice): | ||
"""Double Dimmer-Switch-ZB3.0 by EcoDim / HZC / Shyugj.""" | ||
|
||
signature = { | ||
MODELS_INFO: [ | ||
("EcoDim BV", "EcoDim-Zigbee 3.0"), | ||
], | ||
ENDPOINTS: { | ||
1: { | ||
# <SimpleDescriptor endpoint=1 profile=260 device_type=257 | ||
# input_clusters=[0, 3, 4, 5, 6, 8, 4096] | ||
# output_clusters=[25]> | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
LightLink.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
}, | ||
2: { | ||
# <SimpleDescriptor endpoint=1 profile=260 device_type=257 | ||
# input_clusters=[0, 3, 4, 5, 6, 8, 4096] | ||
# output_clusters=[25]> | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
LightLink.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
}, | ||
242: { | ||
# <SimpleDescriptor endpoint=242 profile=41440 device_type=97 | ||
# input_clusters=[] | ||
# output_clusters=[33] | ||
PROFILE_ID: zgp.PROFILE_ID, | ||
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, | ||
INPUT_CLUSTERS: [], | ||
OUTPUT_CLUSTERS: [ | ||
GreenPowerProxy.cluster_id, | ||
], | ||
}, | ||
}, | ||
} | ||
replacement = { | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
HzcOnOff, # OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
LightLink.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
}, | ||
2: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
HzcOnOff, # OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
LightLink.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
}, | ||
242: { | ||
PROFILE_ID: zgp.PROFILE_ID, | ||
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC, | ||
INPUT_CLUSTERS: [], | ||
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id], | ||
}, | ||
}, | ||
} |