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

Convert IKEA Styrbar quirks to v2 quirk #3175

Merged
merged 3 commits into from
May 29, 2024

Conversation

TheJulianJES
Copy link
Collaborator

@TheJulianJES TheJulianJES commented May 28, 2024

Proposed change

Converts existing IKEA Styrbar quirks to a v2 quirk.
This also adds support for new signatures of the Styrbar, as quirks v2 don't need to match by endpoint/clusters (signature) anymore.

Additional information

The only downside I see is that we use DoublingPowerConfig2AAACluster for all versions of the remote, even if it's a "newer signature". I think we should at least change the default to not double for that first, before we merge this.
Related PR for that:

Would supersede #3144 if we want to go this route.
The test test_quirk_device_automation_triggers_unique also still needs updating that should be done in a separate PR.
It doesn't deal properly with v2 quirks.

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

@MattWestb
Copy link
Contributor

OnOff and Level looks working OK then doing fast testing.
Scene is not working then you was deleting the "IKEA Scene" cluster replacement so need adding it back for getting some functions on left and right buttons.
Have not testing battery or deeper.

I like V2 quirks its much cleaner !!!

@TheJulianJES
Copy link
Collaborator Author

TheJulianJES commented May 29, 2024

Ah, yeah.
I've re-added the ScenesCluster now. Can you try the updated variant?

…ique`

The test does not handle v2 quirks yet and we'll need to see how we want to implement this, as all v2 quirks share the same quirk class.
For now, this just removes the `fourbtnremote` from the test.
This is needed for left/right buttons to work properly
Copy link

codecov bot commented May 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.17%. Comparing base (5ce06cf) to head (9ed616a).
Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3175      +/-   ##
==========================================
- Coverage   88.19%   88.17%   -0.03%     
==========================================
  Files         300      300              
  Lines        9400     9383      -17     
==========================================
- Hits         8290     8273      -17     
  Misses       1110     1110              

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

@MattWestb
Copy link
Contributor

Was updating it from your git and now i getting "scene commands" OK.
But i think long press up and down is not working OK then we is not using all parameter (not in the device log or zha_events but have not testing the DA):

event_type: zha_event
data:
  device_ieee: 8c:f6:81:ff:fe:1e:f3:70
  unique_id: 8c:f6:81:ff:fe:1e:f3:70:1:0x0008
  device_id: 64a05efdf2bd3e0e6e80f89e7c7bf5b4
  endpoint_id: 1
  cluster_id: 8
  command: move
  args:
    - 1
    - 83
    - 0
    - 0
  params:
    move_mode: 1
    rate: 83
    options_mask: 0
    options_override: 0
origin: LOCAL
time_fired: "2024-05-29T15:30:34.903406+00:00"
context:
  id: 01HZ2FJY8QG68NGJZAKA3ZSSED
  parent_id: null
  user_id: null

 event_type: zha_event
data:
  device_ieee: 8c:f6:81:ff:fe:1e:f3:70
  unique_id: 8c:f6:81:ff:fe:1e:f3:70:1:0x0008
  device_id: 64a05efdf2bd3e0e6e80f89e7c7bf5b4
  endpoint_id: 1
  cluster_id: 8
  command: move_with_on_off
  args:
    - 0
    - 83
  params:
    move_mode: 0
    rate: 83
origin: LOCAL
time_fired: "2024-05-29T15:30:39.254780+00:00"
context:
  id: 01HZ2FK2GPKNGR175CY9APVBQ9
  parent_id: null
  user_id: null

Also some users dont like that we is not remember the long press for the release like Open/Close is doing here:

https://github.com/TheJulianJES/zha-device-handlers/blob/9ed616a33e6f973f57f1aec37d67cabcff754aaa/zhaquirks/ikea/opencloseremote.py#L47-L76

@TheJulianJES
Copy link
Collaborator Author

Ok, thanks. But those aren't regressions, right? So no new bugs introduced with this?

@TheJulianJES
Copy link
Collaborator Author

Codecov project coverage decrease is expected, as the old quirk had quite a few lines and is now fully removed with this.

@TheJulianJES TheJulianJES marked this pull request as ready for review May 29, 2024 16:04
@TheJulianJES TheJulianJES merged commit b2751a2 into zigpy:dev May 29, 2024
5 of 6 checks passed
@TheJulianJES TheJulianJES mentioned this pull request May 29, 2024
3 tasks
@MattWestb
Copy link
Contributor

Ok, thanks. But those aren't regressions, right? So no new bugs introduced with this?

I think it was not working OK then we was chaining par/args and it was very much testing for all IKEA controllers then doing that and my memory . . .

I dont have any problems then i using them as Light controller with device and group bindings so its working then ZHA is not OK.

@MattWestb
Copy link
Contributor

Thanks for fixing and closing my V3 that is out of date now !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants