Skip to content
This repository has been archived by the owner on Jul 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #63 from tchellomello/master
Browse files Browse the repository at this point in the history
Version 0.1.0
  • Loading branch information
tchellomello authored Oct 25, 2017
2 parents 559812f + b58564e commit c13e77d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions pyarlo/base_station.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = []
Expand Down Expand Up @@ -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."""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit c13e77d

Please sign in to comment.