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

Add support for camera snapshots #85

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

arroyoj
Copy link

@arroyoj arroyoj commented May 19, 2022

First of all, @MisterWil, thanks for releasing this great library to interact with the Abode API.

I recently added a camera to my Abode system and noticed that in the official Abode app, it is possible to see a preview snapshot image from the camera without taking an image capture that gets recorded to the timeline. Looking in the web app, there is an integrations/v1/camera/[uuid]/snapshot URL that allows retrieving the current snapshot image as a base64-encoded string. The web app uses these snapshots (converted to a data url) as a preview on the live video page.

This PR adds support for retrieving a snapshot image from an Abode camera, modeled on the existing AbodeCamera.capture() interface. The image can either be stored to a file, similar to a captured image, or returned as a base64-encoded data url for easy use in a web app. I only have an Abode Cam 2 (thanks @kevdliu for adding support), so I have not been able to test whether this Abode API works the same for older cameras. I would appreciate further testing by users with other camera versions to make sure it is fully compatible.

This PR also increases the required versions for flake8-docstrings and pydocstyle in the test suite since the previously pinned versions are incompatible with the latest flake8.

@kevdliu
Copy link
Contributor

kevdliu commented May 30, 2022

Unfortunately I don't think @MisterWil is active anymore :(

Do you use Home Assistant by any chance? This change would be super beneficial for the Home Assistant Abode integration. The current integration does not take a snapshot in real-time when a snapshot is requested by HA and instead just retrieves the latest snapshot from the timeline. I tried modifying the integration to take a snapshot in real-time but was unaware that the endpoint I used also creates a snapshot on the timeline and thus generating a ton of unnecessary events on the timeline. I ended up having to revert my change since it was causing too much spam. This change would solve that problem!

@arroyoj
Copy link
Author

arroyoj commented May 31, 2022

@kevdliu, no, I don't use Home Assistant. You're more than welcome to take the code for HA, though. Maybe the snapshot endpoint can be integrated into HA outside of abodepy? I find the snapshot endpoint much easier to use, since it gives you the image data directly, instead of having to first trigger the image capture and then download it.

It's too bad abodepy doesn't seem to be maintained any more. Maybe someone in the HA community would be interested in forking it if it is getting used there?

@jaraco
Copy link

jaraco commented Oct 11, 2022

Please consider contributing this to jaraco/jaraco.abode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants