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

Remove all Philips Hue lighting related quirks #993

Merged
merged 3 commits into from
Aug 26, 2021

Conversation

TheJulianJES
Copy link
Collaborator

@TheJulianJES TheJulianJES commented Aug 12, 2021

Requires zigpy/zigpy#788 (MERGED)
--> released in zigpy 0.37.0 (https://github.com/zigpy/zigpy/releases/tag/0.37.0)

All Philips Hue related lighting quirks are redundant, since zigpy/zigpy#788 was merged.
The "custom" attributes for Hue lights are part of ZCLv7 spec and are now always implemented.

Current (custom) attributes for Hue lighting quirks:

class PhilipsOnOffCluster(CustomCluster, OnOff):
"""Philips OnOff cluster."""
attributes = OnOff.attributes.copy()
attributes.update({0x4003: ("power_on_state", PowerOnState)})
class PhilipsLevelControlCluster(CustomCluster, LevelControl):
"""Philips LevelControl cluster."""
attributes = LevelControl.attributes.copy()
attributes.update({0x4000: ("power_on_level", t.uint8_t)})
class PhilipsColorCluster(CustomCluster, Color):
"""Philips Color cluster."""
attributes = Color.attributes.copy()
attributes.update({0x4010: ("power_on_color_temperature", t.uint16_t)})

Background of why it's a good idea to get all Philips Hue lighting related quirks removed:

Newer Hue firmware (Koenkk/zigbee-OTA#47) changes the signatures of Hue lights.
For the older (ZLL profile) lights, it looks like only the manufacturer name changed.
For the newer (ZHA profile/Bluetooth) lights, it looks like cluster 64514/0xfc02 changed to 64515/0xfc03. (This may only be visible after re-pairing the light).

As the Hue quirks are not needed anymore since zigpy/zigpy#774 and zigpy/zigpy#788, as the attributes are directly implemented in zigpy, this PR would remove all lighting related quirks.

Tested and working with zigpy/zigpy#788.

@coveralls
Copy link

coveralls commented Aug 12, 2021

Pull Request Test Coverage Report for Build 1125150225

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 82.233%

Totals Coverage Status
Change from base Build 1103007488: -0.3%
Covered Lines: 3874
Relevant Lines: 4711

💛 - Coveralls

@codecov-commenter
Copy link

Codecov Report

Merging #993 (9fee132) into dev (8c61c6d) will decrease coverage by 0.31%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #993      +/-   ##
==========================================
- Coverage   82.55%   82.23%   -0.32%     
==========================================
  Files         189      182       -7     
  Lines        4798     4712      -86     
==========================================
- Hits         3961     3875      -86     
  Misses        837      837              
Impacted Files Coverage Δ
zhaquirks/philips/__init__.py 51.11% <ø> (-4.45%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8c61c6d...9fee132. Read the comment docs.

@TheJulianJES TheJulianJES marked this pull request as ready for review August 12, 2021 21:55
@dmulcahey dmulcahey merged commit ecbbc98 into zigpy:dev Aug 26, 2021
@FerretMonger
Copy link

Do i need to re-pair my lights for this to take effect?

@TheJulianJES
Copy link
Collaborator Author

Do i need to re-pair my lights for this to take effect?

No. You just need to be on Home Assistant 2021.9.0 or later.

There are some minor differences (different manufacturer clusters, Signify instead of Philips as the manufacturer name, ...) when re-pairing lights (after having applied firmware updates) but the core functionality of the bulb always works.

@FerretMonger
Copy link

FerretMonger commented Sep 9, 2021 via email

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.

5 participants