Skip to content

Group by endpoints and not by devices for ZHA Zigbee groups#34583

Merged
Adminiuga merged 20 commits into
home-assistant:devfrom
dmulcahey:dm/zha-group-endpoints-not-devices
May 4, 2020
Merged

Group by endpoints and not by devices for ZHA Zigbee groups#34583
Adminiuga merged 20 commits into
home-assistant:devfrom
dmulcahey:dm/zha-group-endpoints-not-devices

Conversation

@dmulcahey
Copy link
Copy Markdown
Contributor

@dmulcahey dmulcahey commented Apr 23, 2020

Proposed change

This PR changes how we group ZHA devices in Zigbee groups. Previously we were adding devices to groups because I misunderstood the API and some of the use cases.

Devices have multiple endpoints and the endpoints are individually group-able. EX: you have a 2 gang light switch where the left switch controls lights in 1 room (dining room for example) and the right switch controls lights in another (kitchen for example). The way groups worked before you weren't able to add the left switch to a group with other devices in the same room. If you did you ended up with the right switch in the group as well.

This PR fixes this and now endpoints can be grouped independently.

Related Frontend PR: home-assistant/frontend#5602

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example entry for configuration.yaml:

# Example configuration.yaml

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link
Copy Markdown

Hey there @Adminiuga, mind taking a look at this pull request as its been labeled with a integration (zha) you are listed as a codeowner for? Thanks!

Copy link
Copy Markdown
Contributor

@Adminiuga Adminiuga left a comment

Choose a reason for hiding this comment

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

Overall looks good, just a few coments.

Comment thread homeassistant/components/zha/api.py Outdated
Comment thread homeassistant/components/zha/core/device.py
@Adminiuga
Copy link
Copy Markdown
Contributor

just 0.01% bellow target coverage :)

@dmulcahey dmulcahey force-pushed the dm/zha-group-endpoints-not-devices branch 2 times, most recently from 5252ef7 to 0211fa2 Compare April 24, 2020 13:45
@Adminiuga
Copy link
Copy Markdown
Contributor

is coverage being flakey?

@dmulcahey
Copy link
Copy Markdown
Contributor Author

I thought so at first but I caught a couple issues with the tests because of it...

@dmulcahey dmulcahey force-pushed the dm/zha-group-endpoints-not-devices branch 6 times, most recently from ad3d571 to 8280805 Compare April 28, 2020 23:02
@Adminiuga
Copy link
Copy Markdown
Contributor

Was this rebased against latest dev? I think there were some fixes for the tests.

@dmulcahey dmulcahey force-pushed the dm/zha-group-endpoints-not-devices branch from 8280805 to 5a19c25 Compare April 29, 2020 11:40
@Adminiuga Adminiuga merged commit 8279efc into home-assistant:dev May 4, 2020
@lock lock Bot locked and limited conversation to collaborators May 5, 2020
@dmulcahey dmulcahey deleted the dm/zha-group-endpoints-not-devices branch December 18, 2021 12:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants