-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add more Inovelli blue switch entities #203
Conversation
b30421a
to
85bae86
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #203 +/- ##
==========================================
+ Coverage 95.89% 95.92% +0.02%
==========================================
Files 61 61
Lines 9413 9464 +51
==========================================
+ Hits 9027 9078 +51
Misses 386 386 ☔ View full report in Codecov by Sentry. |
Are these supported for all devices? |
Seems like the Dimming mode option is only for VZM31-SN and VZM36, the rest are in all three device's parameter table. |
We should restrict those to the models they apply to then |
We also need to make sure the attributes are already merged in the mfg cluster in quirks before this can be merged. We really should migrate all of these to v2 quirks so it’s all in one spot at some point |
do you mean these? https://github.com/zigpy/zha-device-handlers/blob/acecf704f2b253c9297d901eed8909dbd589ea97/zhaquirks/inovelli/__init__.py#L212 sorry I'm very new to this :) |
If they are common across all devices they go in the base class: https://github.com/zigpy/zha-device-handlers/blob/acecf704f2b253c9297d901eed8909dbd589ea97/zhaquirks/inovelli/__init__.py#L94 Otherwise they go in the appropriate extension |
yes, all these attributes are already there. |
"""Inovelli dimming mode selection.""" | ||
|
||
LeadingEdge = 0x00 | ||
TrailingEdge = 0x01 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should start migrating the Inovelli attributes in the quirk to the new Zigpy format, this will keep enums like this out of ZHA:
class LeadingOrTrailingEdge(t.enum8):
LeadingEdge = 0x00
TrailingEdge = 0x01
class InovelliVZM31SNCluster(CustomCluster):
name = "InovelliVZM31SNCluster"
class AttributeDefs(BaseAttributeDefs):
"""Attribute definitions."""
...
leading_or_trailing_edge = ZCLAttributeDef(
id=0x001A,
type=LeadingOrTrailingEdge,
zcl_type=DataTypeId.bool, # It's really a bool on the device
is_manufacturer_specific=True,
)
...
No description provided.