tchellomello / python-arlo

Python Arlo is a library written in Python 2.7/3x that exposes the Netgear Arlo cameras as Python objects.
GNU Lesser General Public License v3.0
100 stars 35 forks source link

Updating the Camera Snapshot #19

Closed chaddotson closed 7 years ago

chaddotson commented 7 years ago

I'm wanting to script grabbing an image from each of my cameras. Is there anyway to update each camera's current snapshot?

chaddotson commented 7 years ago

I figured out the endpoint and payload for taking a manual snapshot but unfortunately that does not update the "lastImage".

tchellomello commented 7 years ago

@chaddotson did you try to run camera.update() to refresh the object? Could you share your script?

from pyarlo import PyArlo
arlo = PyArlo('user, 'password')
for camera in arlo.cameras:
    camera.update()
    name = "pic-{0}.jpg".format(camera.name)
    camera.last_video.download_thumbnail(name)
tchellomello commented 7 years ago

@chaddotson did it work for you?

chaddotson commented 7 years ago

Sorry got distracted by something else. I believe it worked to a point. Seems I had trouble making sure it always worked. I can't remember the details, will verify this week.

chaddotson commented 7 years ago

@tchellomello negatory.

from logging import basicConfig, getLogger,  DEBUG, INFO
from pyarlo import PyArlo

logger = getLogger(__name__)

logging_config = dict(level=INFO, format='[%(asctime)s - %(filename)s:%(lineno)d - %(funcName)s - %(levelname)s] %(message)s')
basicConfig(**logging_config)

arlo = PyArlo(username, password)
for camera in arlo.cameras:
    camera.update()

    name = "{0}.jpg".format(camera.name)
    logger.info('Camera updated, saving \"%s\" to \"%s\"', camera.name, name)
    camera.last_video.download_thumbnail(name)`

It grabs the last thumbnail but does not grab the current live snapshot.

tchellomello commented 7 years ago

@chaddotson correct that is the current behavior. We are working to get a way to capture the live streaming as you can see at #8

tchellomello commented 7 years ago

Closing this in reference to #8