示例#1
0
 def _update_last_image_from_snapshot(self):
     self._arlo.debug('getting image for ' + self.name)
     url = self._arlo._st.get([self.device_id, SNAPSHOT_KEY], None)
     if url is not None:
         img = http_get(url)
         if img is not None:
             # signal up if nedeed
             self._save_and_do_callbacks(LAST_IMAGE_DATA_KEY, img)
示例#2
0
    def _update_last_image(self):
        self._arlo.debug('getting image for ' + self.name)
        img = None
        url = self._arlo._st.get([self.device_id, LAST_IMAGE_KEY], None)
        if url is not None:
            img = http_get(url)
        if img is None:
            self._arlo.debug('using blank image for ' + self.name)
            img = self._arlo.blank_image

        # signal up if nedeed
        self._save_and_do_callbacks(LAST_IMAGE_DATA_KEY, img)
示例#3
0
    def _update_last_image_from_snapshot( self ):
        self._arlo.debug('getting image for ' + self.name )
        url = self._arlo._st.get( [self.device_id,SNAPSHOT_KEY],None )
        if url is not None:
            img = http_get( url )
            if img is not None:
                # signal up if nedeed
                self._arlo._st.set( [self.device_id,LAST_IMAGE_SRC_KEY],'snapshot/' + now_strftime(self._arlo._last_format) )
                self._save_and_do_callbacks( LAST_IMAGE_DATA_KEY,img )

        # handle snapshot finished
        self._clear_snapshot()
示例#4
0
    def _update_last_image_from_snapshot( self ):
        self._arlo.debug('getting image for ' + self.name )
        url = self._arlo._st.get( [self.device_id,SNAPSHOT_KEY],None )
        if url is not None:
            img = http_get( url )
            if img is not None:
                # signal up if nedeed
                self._arlo._st.set( [self.device_id,LAST_IMAGE_SRC_KEY],'snapshot/' + now_strftime(self._arlo._last_format) )
                self._save_and_do_callbacks( LAST_IMAGE_DATA_KEY,img )

        # we saved state around the snapshot
        if self._snapshot_state is not None and self.is_taking_snapshot:
            self._arlo.debug( 'our snapshot finished, restoring state' )
            self._save_and_do_callbacks( ACTIVITY_STATE_KEY,self._snapshot_state )
            self._snapshot_state = None
示例#5
0
    def _update_last_image( self ):
        self._arlo.debug('getting image for ' + self.name )
        img = None
        url = self._arlo._st.get( [self.device_id,LAST_IMAGE_KEY],None )
        if url is not None:
            img = http_get( url )
        if img is None:
            self._arlo.debug('using blank image for ' + self.name )
            img = self._arlo.blank_image

        # signal up if nedeed
        self._arlo._st.set( [self.device_id,LAST_IMAGE_SRC_KEY],'capture/' + now_strftime(self._arlo._last_format) )
        self._save_and_do_callbacks( LAST_IMAGE_DATA_KEY,img )

        # handle snapshot not being handled...
        self._clear_snapshot()
示例#6
0
 def download_video(self, filename=None):
     return http_get(self.video_url, filename)
示例#7
0
 def download_thumbnail(self, filename=None):
     return http_get(self.thumbnail_url, filename)
示例#8
0
 def get_video(self):
     video = self.last_video
     if video is not None:
         return http_get(video.video_url)
     return None