reolink: Added device detection + trackmix stream #1154
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a follow up to #1020.
I've added device detection so the
autotrack
stream is only added if it is a TrackMix device and kept the cleanup of loops and arrays etc. There's a lot more we could implement using the device information, could automatically configure a doorbell, set known-good configuration for each model etc. but this is a good place to start.Unfortunately the way we are interacting with the API seems to not be supported by all devices - my doorbell doesn't seem to like the encoding & info GET requests. Based on the semi-official/supported python API we should be generating a token after login to be used in a
POST
request. I've tested this library and seems to work well across all my cameras & doorbell, so maybe a follow-up PR to update the API functions to match it? See here for the function in question.