Example #1
0
    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
        self._session = arlo_session
        self._session_token = session_token
        self._available_modes = None
        self._available_mode_ids = None
        self._camera_properties = None
        self._camera_extended_properties = None
        self._ambient_sensor_data = None
        self._last_refresh = None
        self._refresh_rate = refresh_rate
        self.__sseclient = None
        self.__subscribed = False
        self.__events = []
        self.__event_handle = None

        self._attrs = assert_is_dict(self._attrs)
Example #2
0
    def update(self):
        """Update object properties."""
        self._attrs = self._session.refresh_attributes(self.name)
        self._attrs = assert_is_dict(self._attrs)

        # force base_state to update properties
        if self.base_station:
            self.base_station.update()
Example #3
0
    def __init__(self, attrs, camera, arlo_session):
        """Initialiaze Arlo Video object.

        :param attrs: Video attributes
        :param camera: Arlo camera which recorded the video
        :param arlo_session: Arlo shared session
        """
        self._attrs = attrs
        self._attrs = assert_is_dict(self._attrs)
        self._camera = camera
        self._session = arlo_session
Example #4
0
    def update(self):
        """Update object properties."""
        current_time = int(time.time())
        last_refresh = 0 if self._last_refresh is None else self._last_refresh

        if current_time >= (last_refresh + self._refresh_rate):
            self.get_cameras_properties()
            self.get_ambient_sensor_data()
            self._attrs = self._session.refresh_attributes(self.name)
            self._attrs = assert_is_dict(self._attrs)
            _LOGGER.debug(
                "Called base station update of camera properties: "
                "Scan Interval: %s, New Properties: %s", self._refresh_rate,
                self.camera_properties)
Example #5
0
    def __init__(self, name, attrs, arlo_session,
                 min_days_vdo_cache=PRELOAD_DAYS):
        """Initialize Arlo camera object.

        :param name: Camera name
        :param attrs: Camera attributes
        :param arlo_session: PyArlo shared session
        :param min_days_vdo_cache: min. days to preload in video cache
        """
        self.name = name
        self._attrs = attrs
        self._session = arlo_session
        self._cached_videos = None
        self._min_days_vdo_cache = min_days_vdo_cache

        # make sure self._attrs is a dict
        self._attrs = assert_is_dict(self._attrs)