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 )
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 False: # 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()
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