def test_events_v2_download(self): events = self.b.eventsv2() if len(events) == 0: return event = events[0] content = self.b.download_video_v2(event) filename = self.b.get_event_name_v2(event) blink.save_to_file(content, "event_" + filename)
def test_homescreen(self): data = self.b.homescreen() self.assertTrue(data['account'] is not None) self.assertTrue(data['network'] is not None) for device in data['devices']: if device['device_type'] is not None and device[ 'device_type'] == "camera": content, filename = self.b.download_thumbnail_home_v2(device) blink.save_to_file(content, "home_" + filename)
def test_refresh_all_cameras_thumbnail(self): self.b.refresh_all_cameras_thumbnail() data = self.b.homescreen() for device in data['devices']: if device['device_type'] is not None and device[ 'device_type'] == "camera": content, filename = self.b.download_thumbnail_home_v2(device) filename = "test_refresh_" + filename blink.save_to_file(content, filename) print("Download latest thumbnails to " + filename)
def test_events_from_camera(self): ids = self.b.list_camera_ids() if len(ids) > 0: id = ids[0] events = self.b.events_from_camera(id, 1) if len(events) > 0: event = events[0] content = self.b.download_video_v2(event) filename = self.b.get_event_name_v2(event) blink.save_to_file(content, "event_camera_" + filename)
print('Camera IDs are:') for id in cameraids: print(id) cameraInfo = b.get_camera_info() print('Camera Info: ' + str(cameraInfo)) cameraSensorInfo = b.get_camera_sensor_info() print('Camera Sensor Info: ' + str(cameraSensorInfo)) # Update all cameras and download latest thumbnails b.refresh_all_cameras_thumbnail() data = b.homescreen() for device in data['devices']: if device['device_type'] is not None and device[ 'device_type'] == "camera": content, filename = b.download_thumbnail_home_v2(device) blink.save_to_file(content, filename) print("Download latest thumbnails to " + filename) # Download latest events from all cameras print("Download latest events from all cameras") events = b.eventsv2() for event in events: content = b.download_video_v2(event) filename = b.get_event_name_v2(event) blink.save_to_file(content, filename) # Download latest events from one camera print("Download latest events from one camera") if len(cameraids) > 0: id = cameraids[0] # Download at most 5 event from this camera