Skip to content

Conversation

@raido
Copy link

@raido raido commented Oct 27, 2025

Proposed change

This PR is implementing long release dim down action support similar to https://github.com/zigpy/zha-device-handlers/blob/dev/zhaquirks/ikea/opencloseremote.py

This should resolve #2024

Additional information

Since stop_with_on_off event is no longer bound to replacements, it will be fired as well and is be visible in device's activity log.

Device diagnostics

Checklist

  • The changes are tested and work correctly
  • pre-commit checks pass / the code has been formatted using Black
  • Tests have been added to verify that the new code works
  • Device diagnostics data has been attached

@raido raido force-pushed the ikea-remote-dim-down-long-press branch from 57fff7a to feaf79c Compare October 27, 2025 07:07
@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 47.36842% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.05%. Comparing base (6ab11ea) to head (1a9f468).
⚠️ Report is 12 commits behind head on dev.

Files with missing lines Patch % Lines
zhaquirks/ikea/twobtnremote.py 47.36% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #4433      +/-   ##
==========================================
- Coverage   92.12%   92.05%   -0.08%     
==========================================
  Files         358      358              
  Lines       11917    11935      +18     
==========================================
+ Hits        10979    10987       +8     
- Misses        938      948      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MattWestb
Copy link
Contributor

I dont knowing if its working then i have not the coding knowledge but i think its great that is being implemented !!
Woht i dont like is the naming of the "new" cluster LevelControl.cluster_id > IkeaRemoteLongReleaseControl.
For the open/Close its made like class IkeaWindowCovering(CustomCluster, WindowCovering): and its keeping the ground functionality if the cluster andithink we shall do the same for this devices.

@raido
Copy link
Author

raido commented Oct 27, 2025

I can rename it to IkeaLevelControl to keep it similar with IkeaWindowCovering example.

@TheJulianJES TheJulianJES added missing tests PR has no tests and might need them needs reviewer answer An answer from a reviewer is needed (e.g. why a PR isn't acceptable in the current state). labels Oct 28, 2025
@raido
Copy link
Author

raido commented Oct 30, 2025

Since there are no tests for those 2 button remotes at all, I tried to setup some but I am not quite sure where can I get NodeDescriptor in a format as in other tests. The JSON copied from device signature view in ZHA doesn't match in test that I've included in below.

The README example also has NodeDescriptor() example but no info about how get this exact format.

Example signature matching test case

def test_ikea_2btnremote(assert_signature_matches_quirk):
    """Test new 'Tradfi,Rodret table' signature is matched to its quirk."""
signature = {
    "node_descriptor": {
        "logical_type": 2,
        "complex_descriptor_available": 0,
        "user_descriptor_available": 0,
        "reserved": 0,
        "aps_flags": 0,
        "frequency_band": 8,
        "mac_capability_flags": 128,
        "manufacturer_code": 4476,
        "maximum_buffer_size": 82,
        "maximum_incoming_transfer_size": 82,
        "server_mask": 11264,
        "maximum_outgoing_transfer_size": 82,
        "descriptor_capability_field": 0,
    },
    "endpoints": {
        1: {
            "profile_id": "0x0104",
            "device_type": "0x0820",
            "input_clusters": [
                "0x0000",
                "0x0001",
                "0x0003",
                "0x0020",
                "0x1000",
                "0xfc7c",
            ],
            "output_clusters": [
                "0x0003",
                "0x0004",
                "0x0006",
                "0x0008",
                "0x0019",
                "0x1000",
            ],
        }
    },
    "manufacturer": "IKEA of Sweden",
    "model": "RODRET Dimmer",
    "class": "ikea.twobtnremote.IkeaRodretRemote2Btn",
}

assert_signature_matches_quirk(
    zhaquirks.ikea.twobtnremote.IkeaRodretRemote2Btn, signature
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing tests PR has no tests and might need them needs reviewer answer An answer from a reviewer is needed (e.g. why a PR isn't acceptable in the current state).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TRADFRI on/off switch not firing DIM_DOWN events

3 participants