-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
Automatically add newly added devices for UniFi Protect #73879
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
Conversation
Hey there @briis, @bdraco, mind taking a look at this pull request as it has been labeled with an integration ( |
Now I have to go find a new device to test with :) |
Existing functionality testing looks good. Still looking for a device I can wipe and re-adopt. If I can't find one that works I'll factory reset a camera later today when I'm back at the house and don't need to worry about one actually recording |
|
No more tracebacks in the log, but it looks like motion gets added twice.
|
The unique id conflict is a regression introduced in #73768 and unrelated to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the comment in a new PR. Thanks!
Proposed change
Automatically adds any new devices that are newly adopted within UniFi Protect.
This is primarily done by listening for a "Device Adopted" event and then initiating a dispatch to process the newly added device for all of the supported platforms. The only except to this is camera entities. When a Camera is adopted, it has no camera channels initially, so camera entities cannot be initialized. It adds the device ID to a list and wait until an update event comes in for that device with the camera channels and then sends another dispatch.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: