Skip to content

Use ZeroconfServiceInfo in gogogate2#59746

Merged
bdraco merged 3 commits intohome-assistant:devfrom
epenet:zeroconf-gogogate2
Nov 18, 2021
Merged

Use ZeroconfServiceInfo in gogogate2#59746
bdraco merged 3 commits intohome-assistant:devfrom
epenet:zeroconf-gogogate2

Conversation

@epenet
Copy link
Copy Markdown
Contributor

@epenet epenet commented Nov 15, 2021

Proposed change

Use ZeroconfServiceInfo in gogogate2

Followup to #59745

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

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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

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

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link
Copy Markdown

Hey there @vangorra, @bdraco, mind taking a look at this pull request as it has been labeled with an integration (gogogate2) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Nov 15, 2021

Note: needs rebase after #59745 is merged

@epenet epenet force-pushed the zeroconf-gogogate2 branch from 6f26adc to 9ddad7c Compare November 16, 2021 05:33
@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Nov 16, 2021

Rebased now #59745 is merged

@epenet epenet marked this pull request as ready for review November 16, 2021 05:34
"""Handle homekit discovery."""
await self.async_set_unique_id(discovery_info["properties"]["id"])
return await self._async_discovery_handler(discovery_info["host"])
await self.async_set_unique_id(discovery_info[zeroconf.ATTR_PROPERTIES]["id"])
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we add a constant for id since its a defined field for homekit?

Copy link
Copy Markdown
Contributor Author

@epenet epenet Nov 16, 2021

Choose a reason for hiding this comment

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

id is harder to pinpoint with grep, but I had a quick scan of the components and there does seem to be a few components using it. Should I add ATTR_PROPERTIES_ID constant to zeroconf?
It's a bit long, and I could add ATTR_ID but I am worried about adding confusion with the base attributes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Or maybe you want me to add the constant to homekit?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

HomeKit discovery is a subset of zeroconf discovery. I think you have it in the right place.

I hate to ask for a one line change, but It really should be a separate PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought you wanted it in this PR... I have reverted it now.

@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Nov 16, 2021

Note: CI failed due to a flaky test in tado and do not fail locally

@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label Nov 16, 2021
@bdraco
Copy link
Copy Markdown
Member

bdraco commented Nov 16, 2021 via email

@epenet epenet force-pushed the zeroconf-gogogate2 branch from 0a6c7a1 to ceadda2 Compare November 16, 2021 16:42
@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Nov 16, 2021

Rebased to re-trigger CI following #59787

@frenck frenck requested a review from bdraco November 17, 2021 07:29
@epenet
Copy link
Copy Markdown
Contributor Author

epenet commented Nov 18, 2021

Note: CI is failing just because of codecov/patch

@bdraco bdraco merged commit 9ccee20 into home-assistant:dev Nov 18, 2021
@epenet epenet deleted the zeroconf-gogogate2 branch November 18, 2021 18:41
@epenet epenet mentioned this pull request Nov 19, 2021
22 tasks
@github-actions github-actions bot locked and limited conversation to collaborators Nov 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed code-quality has-tests integration: gogogate2 small-pr PRs with less than 30 lines. smash Indicator this PR is close to finish for merging or closing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants