Skip to content

Conversation

starkillerOG
Copy link
Contributor

@starkillerOG starkillerOG commented Apr 13, 2025

Breaking change

Proposed change

When connecting a camera both through a NVR/Home Hub and directly, the get_device_uid_and_ch function could select the wrong device UID causing problems.
This PR ensures the correct UID is selected.

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.

To help with the load of incoming pull requests:

@starkillerOG starkillerOG added this to the 2025.4.3 milestone Apr 13, 2025
@bdraco
Copy link
Member

bdraco commented Apr 13, 2025

Since the code was non-obvious enough to need a fix, this seems like a case that really deserves a test. Let's make sure one is added before the PR moves forward.

Copy link
Member

@zweckj zweckj left a comment

Choose a reason for hiding this comment

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

oh, what bdraco said

@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@home-assistant home-assistant bot marked this pull request as draft April 14, 2025 07:47
@starkillerOG starkillerOG marked this pull request as ready for review April 14, 2025 17:44
@home-assistant home-assistant bot requested a review from zweckj April 14, 2025 17:44
@starkillerOG
Copy link
Contributor Author

@bdraco @zweckj I just added a test that would have failed withouth the changes of this PR.
It checks the correct device_uid is retrieved no matter the order of the identifiers.

@zweckj zweckj merged commit 40fd7cf into home-assistant:dev Apr 14, 2025
34 checks passed
@starkillerOG starkillerOG deleted the reolink_device_uid branch April 14, 2025 18:43
@github-actions github-actions bot locked and limited conversation to collaborators Apr 15, 2025
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