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

Fix unique_id not being unique in HomeWizard #117940

Merged
merged 5 commits into from
May 27, 2024

Conversation

DCSBL
Copy link
Contributor

@DCSBL DCSBL commented May 22, 2024

Proposed change

Migrate unique_id of externally connected device (e.g. Gas meter connected to smart meter) from homewizard_<EAN> to homewizard_<type>_<EAN>. This make is less likely that an user has two device with same unique ID.

EAN should be unique, but due to an issue at Fluvius the may be all zeros. This triggers issue #117557.

Bumbs python-homewizard-energy to v6.0.0:

Closes #117557

I think we are not in a hurry, so we can add this in 2024.6. This also helps us testing the migration and to see if this issue is actually fixed for the end user, I can only mock data.

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)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

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
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format 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.

To help with the load of incoming pull requests:

@balloob
Copy link
Member

balloob commented May 23, 2024

What
CleanShot 2024-05-22 at 23 16 12@2x

@DCSBL
Copy link
Contributor Author

DCSBL commented May 23, 2024

Whow wait..
Lemme double check what is up with that snapshot file. Is should not be that different…

@DCSBL DCSBL marked this pull request as draft May 23, 2024 04:02
@DCSBL
Copy link
Contributor Author

DCSBL commented May 23, 2024

So, because I've inserted the test fixtures in test_sensors() instead of appending it, it adjusted a lot of snapshot ID's.

I've reordered the parameters and it is now okay-ish.

Sorry for not spotting this!

@DCSBL DCSBL marked this pull request as ready for review May 23, 2024 08:28
@frenck frenck force-pushed the homewizard-missing-id-fix branch from d87dcbb to aa5be63 Compare May 24, 2024 20:44
@frenck frenck added the smash Indicator this PR is close to finish for merging or closing label May 25, 2024
Copy link
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks, @DCSBL 👍

../Frenck

@frenck frenck merged commit 22cc7d3 into home-assistant:dev May 27, 2024
38 checks passed
@DCSBL DCSBL deleted the homewizard-missing-id-fix branch May 27, 2024 11:12
@DCSBL
Copy link
Contributor Author

DCSBL commented May 27, 2024

Thanks Frenck!

@github-actions github-actions bot locked and limited conversation to collaborators May 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bugfix by-code-owner cla-signed has-tests integration: homewizard Quality Scale: platinum 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.

HomeWizard gas values/sensors not available anymore
3 participants