-
Notifications
You must be signed in to change notification settings - Fork 712
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore missing default reply for GLEDOPTO AC dimmer (#2330)
* Use `NoReplyMixin` for GLEDOPTO dimmer * Move `NoReplyMixin` to main `__init__.py` file
- Loading branch information
1 parent
529e630
commit fb5d256
Showing
3 changed files
with
116 additions
and
39 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
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,77 @@ | ||
"""Quirk for GLEDOPTO GL-SD-001.""" | ||
|
||
from zigpy.profiles import zha | ||
from zigpy.quirks import CustomCluster, CustomDevice | ||
from zigpy.zcl.clusters.general import ( | ||
Basic, | ||
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 LevelControlNoReply(NoReplyMixin, CustomCluster, LevelControl): | ||
"""LevelControl cluster that does not require default responses.""" | ||
|
||
void_input_commands = {cmd.id for cmd in LevelControl.commands_by_name.values()} | ||
|
||
|
||
class GledoptoGlSd001(CustomDevice): | ||
"""Gledopto GL-SD-001 dimmer custom device implementation.""" | ||
|
||
signature = { | ||
MODELS_INFO: [("GLEDOPTO", "GL-SD-001")], | ||
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, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
LightLink.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Ota.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, | ||
OnOff.cluster_id, | ||
LevelControlNoReply, | ||
LightLink.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Ota.cluster_id, | ||
], | ||
}, | ||
}, | ||
} |
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