Blink integration marks motion detection clips as already seen when snapping pictures to save them locally #799
Labels
bug
There is an issue causing unexpected results
help-wanted
Assistance required due to lack of resources for testing or complexity
Describe the bug
This happens since HA stable docker image version
2023.8.2
I created the automation (based on this official example) that is marking clips recorded from motion detection as seen whenever this automation is executed and new motion clips were recorded:
It seems this
GET
is what is marking my video as seen:2023-08-29 11:18:18.369 DEBUG (SyncWorker_44) [blinkpy.api] Making GET request to https://rest-e002.immedia-semi.com/api/v3/media/accounts/XXXXXX/networks/369464/lotus/86269/pir/3654965765.mp4
Let's check the code, it seems HA version
2023.8.2
includesblinkpy
version0.21.0
that includes this PR: Add get_videos_metadata function (@rhhayward #685)Hmmm, could it be that this PR (introduced in
blinkpy-0.21.0
that comes with HA2023.8.2
) raises this issue as a side effect?Tracing back from said log line we get to:
http_get
in fileapi.py
that is called fromdo_http_get
in fileblinkpy.py
that is called from_parse_downloaded_items
also in fileblinkpy.py
that was modified in the PR referenced above and is marked with a warning:Added line #L415 was not covered by tests
Hope this helps.
To Reproduce
Steps to reproduce the behaviour:
Expected behavior
This PR added the possibility to retrieve clips' metadata, but since its merge (
blinkpy
version0.21.0
) motion detection clips are being marked as read. It seems that it downloads the video, marking it as seen on blink servers, only to get its metadata. It shouldn't mark motion clips as already seen if they weren't downloaded by the user whatsoever.Home Assistant version (if applicable): since
2023.8.2
blinkpy
version (not needed if filling out Home Assistant version): since0.21.0
Log Output/Additional Information
If using home-assistant, please paste the output of the log showing your error below. If not, please include any additional useful information.
The text was updated successfully, but these errors were encountered: