From ff85369115072c6d2f0f40cf3560f850d8c085ef Mon Sep 17 00:00:00 2001 From: Marcelo Moreira de Mello Date: Wed, 25 Oct 2017 02:47:19 -0400 Subject: [PATCH 1/2] Bump version to 0.1.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6ca07af..875223c 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='pyarlo', packages=['pyarlo'], - version='0.0.9', + version='0.1.0', description='Python Arlo is a library written in Python 2.7/3x ' + 'that exposes the Netgear Arlo cameras as Python objects.', author='Marcelo Moreira de Mello', From 3a94ddc7865741e6d70fa3238e40e77cc84fe9cf Mon Sep 17 00:00:00 2001 From: Marcelo Moreira de Mello Date: Wed, 25 Oct 2017 03:15:06 -0400 Subject: [PATCH 2/2] Introduced refresh_rate as property --- pyarlo/base_station.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/pyarlo/base_station.py b/pyarlo/base_station.py index fa5aea7..3efe6f7 100644 --- a/pyarlo/base_station.py +++ b/pyarlo/base_station.py @@ -16,13 +16,15 @@ class ArloBaseStation(object): """Arlo Base Station module implementation.""" - def __init__(self, name, attrs, session_token, arlo_session): + def __init__(self, name, attrs, session_token, arlo_session, + refresh_rate=REFRESH_RATE): """Initialize Arlo Base Station object. :param name: Base Station name :param attrs: Attributes :param session_token: Session token passed by camera class :param arlo_session: PyArlo shared session + :param refresh_rate: Attributes refresh rate. Defaults to 15 """ self.name = name self._attrs = attrs @@ -32,7 +34,7 @@ def __init__(self, name, attrs, session_token, arlo_session): self._available_mode_ids = None self._camera_properties = None self._last_refresh = None - self._refresh_rate = REFRESH_RATE + self._refresh_rate = refresh_rate self.__sseclient = None self.__subscribed = False self.__events = [] @@ -245,6 +247,22 @@ def xcloud_id(self): """Return X-Cloud-ID attribute.""" return self._attrs.get('xCloudId') + @property + def last_refresh(self): + """Return last_refresh attribute.""" + return self._last_refresh + + @property + def refresh_rate(self): + """Return refresh_rate attribute.""" + return self._refresh_rate + + @refresh_rate.setter + def refresh_rate(self, value): + """Override the refresh_rate attribute.""" + if isinstance(value, (int, float)): + self._refresh_rate = value + @property def available_modes(self): """Return list of available mode names."""