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 Philips RDM004 (HUE Wall Switch rev 004) to quirks #3237

Open
wants to merge 26 commits into
base: dev
Choose a base branch
from

Conversation

Tijgerd
Copy link

@Tijgerd Tijgerd commented Jul 1, 2024

Proposed change

Added the RDM004 to the quirks.
Credits to Regenbui (Wesley Westerveld): https://community.home-assistant.io/t/how-to-configure-the-philips-hue-wall-module-to-use-push-button-momentary-type-wall-switches-zha/451125/27

Additional information

The RDM004 was not usable in ZHA, the fix as proposed by "Regenbui" was working as expected!
Also fixed a minor

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

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

Attention: Patch coverage is 76.31579% with 9 lines in your changes missing coverage. Please review.

Project coverage is 88.22%. Comparing base (8317dc6) to head (3a5a470).
Report is 15 commits behind head on dev.

Files Patch % Lines
zhaquirks/philips/rdm004.py 75.67% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #3237      +/-   ##
==========================================
+ Coverage   88.18%   88.22%   +0.03%     
==========================================
  Files         301      303       +2     
  Lines        9412     9484      +72     
==========================================
+ Hits         8300     8367      +67     
- Misses       1112     1117       +5     

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

attributes.update(
{
0x0031: ("philips", t.bitmap16, True),
0x0034: ("mode", t.enum8, True),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some spaces is after the comma that the tests dont like.
Put in 0x0034: ("mode", t.enum8, True), and it shall working OK

@MattWestb
Copy link
Contributor

Looks nice but one new error is detected:

zhaquirks/philips/rdm004.py:3:1: UP035 `typing.List` is deprecated, use `list` instead
Found 1 error.

Error: Process completed with exit code 1.

I dont knowing if its only tinging the command or its needs more work then im not one code warier.

removed typing.List depency
@Tijgerd
Copy link
Author

Tijgerd commented Jul 1, 2024

Give me a second :D will fix this!
But it was working in home assistant like a charm

fixed List to list
@MattWestb
Copy link
Contributor

MattWestb commented Jul 1, 2024

All green !!!!
Only function code test implantation failing.

@Tijgerd
Copy link
Author

Tijgerd commented Jul 1, 2024

I see this is also failing on the RDM001 (and will possibly also fail on the other quirks in the Philips folder.
Looking into this but I am not able to properly debug this myself at the moment..

@Tijgerd
Copy link
Author

Tijgerd commented Jul 11, 2024

This I am unable to get the tests to work...
I am running the custom quirk for over a week now without any problem, it is just the test that I am unable to integrate..


assert_signature_matches_quirk(
zhaquirks.philips.rdm001.PhilipsRDM001, signature
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its one space after the ) that making the test complaining.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other:

+++ b/tests/test_philips.py
@@ -1,11 +1,7 @@
 """Tests for Philips RDM001 and RDM004 quirks."""
-import pytest
 
-from tests.common import ClusterListener
 
 import zhaquirks
-from zhaquirks.philips.rdm001 import PhilipsRDM001
-from zhaquirks.philips.rdm004 import PhilipsRDM004
 
 zhaquirks.setup()

Its looks the test i not liking importing this function but i dont knowing if its needed for the code or not then im not one code warier.
I think Puddly or TheJullian is knowing it bettter.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, the space after the ) was not the problem apparently

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first error is now gone only the import section and the the strange last ones . . . so one step forewords and . . .

@TheJulianJES TheJulianJES added the needs review This PR should be reviewed soon label Aug 3, 2024
@TheJulianJES TheJulianJES added the pre-commit.ci run Re-run pre-commit CI hook to automatically fix pre-commit issues. label Aug 26, 2024
@pre-commit-ci pre-commit-ci bot removed the pre-commit.ci run Re-run pre-commit CI hook to automatically fix pre-commit issues. label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review This PR should be reviewed soon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants