Skip to content
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

Merged
merged 1 commit into from
Sep 25, 2024
Merged

Conversation

tleydxdy
Copy link
Contributor

No description provided.

@tleydxdy tleydxdy force-pushed the tleydxdy branch 2 times, most recently from b30421a to 85bae86 Compare September 15, 2024 19:27
Copy link

codecov bot commented Sep 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.92%. Comparing base (cde2148) to head (b996deb).
Report is 7 commits behind head on dev.

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.
📢 Have feedback on the report? Share it here.

@dmulcahey
Copy link
Contributor

Are these supported for all devices?

@tleydxdy
Copy link
Contributor Author

Seems like the Dimming mode option is only for VZM31-SN and VZM36, the rest are in all three device's parameter table.

@dmulcahey
Copy link
Contributor

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

@dmulcahey
Copy link
Contributor

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

@tleydxdy
Copy link
Contributor Author

@dmulcahey
Copy link
Contributor

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

@tleydxdy
Copy link
Contributor Author

yes, all these attributes are already there.

"""Inovelli dimming mode selection."""

LeadingEdge = 0x00
TrailingEdge = 0x01
Copy link
Contributor

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,
        )

        ...

@TheJulianJES TheJulianJES added the entities Issue or PR about (custom) entities label Sep 24, 2024
@puddly puddly merged commit afa6046 into zigpy:dev Sep 25, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
entities Issue or PR about (custom) entities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants