python arlo是一个用python 2.7/3x编写的库,它将netgear arlo摄像头公开为python对象。
pyarlo的Python项目详细描述
安装
$ pip install pyarlo
# Install latest development
$ pip install git+https://github.com/tchellomello/python-arlo
用法
# connectingfrompyarloimportPyArloarlo=PyArlo('foo@bar','secret')# listing devicesarlo.devices# listing base stationsarlo.base_stations# get base station handle# assuming only 1 base station is availablebase=arlo.base_stations[0]# get the current base station modebase.mode# 'disarmed'# listing Arlo modesbase.available_modes# ['armed', 'disarmed', 'schedule', 'custom']# Updating the base station modebase.mode='custom'# listing all camerasarlo.cameras# showing camera preferencescam=arlo.cameras[0]# check if camera is connected to base stationcam.is_camera_connected# True# printing camera attributescam.serial_numbercam.model_idcam.unseen_videos# get brightness value of cameracam.brightness# get signal strength of camera with base stationcam.signal_strength# get flip property from cameracam.flip_state# get mirror property from cameracam.mirror_state# get power save mode value from cameracam.powersave_mode# get current battery level of cameracam.battery_level92# get boolean result if motion detection# is enabled or notbase.is_motion_detection_enabled# True# get battery levels of all cameras# prints serial number and battery level of each camerabase.get_cameras_battery_level# {'4N71235T12345': 92, '4N71235T12345': 90}# get base station propertiesbase.properties# get camera propertiesbase.get_camera_properties# get camera rulesbase.get_camera_rules# get camera schedulebase.get_camera_schedule# get camera motion detection sensitivitycam.get_motion_detection_sensitivity# refreshing camera propertiescam.update()# gathering live_streaming URLcam.live_streaming()# rtmps://vzwow72-z2-prod.vz.netgear.com:80/vzmodulelive?egressToken=b723a7bb_abbXX&userAgent=web&cameraId=48AAAAA# gather last recorded video URLcam.last_video.video_url
加载视频
# by default, all videos recorded within# the last 30 days will be pre-loadedarlo.ArloMediaLibrary.videos# Or you can load Arlo videos directlyfrompyarlo.mediaimportArloMediaLibrarylibrary=ArloMediaLibrary(arlo,days=2)len(library.videos)# showing a video propertiesmedia=library.videos[0]# printing video attributesmedia.cameramedia.content_typemedia.media_duration_seconds# displaying thumbnail to stdoutmedia.download_thumbnail()# downloading videomedia.download_video('/home/user/demo.mp4')
环境传感器数据使用情况(爱洛婴儿监视器)
# Get the base_station instance corresponding to the Arlo Babybase_station=arlo.base_stations[0]# Store all ambient sensor history in self._ambient_sensor_data# All of the accessor properties will call this if values are not cached.base_station.get_ambient_sensor_data()# Get cached sensor history (property)base_station.ambient_sensor_data# Get most recent temperature reading in degrees celsius (property)base_station.ambient_temperature# Get most recent humidity reading in relative humidity percentage (property)base_station.ambient_humidity# Get most recent air quality reading (property)# Not 100% sure on the unit of measure, but would assume it's VOC PPMbase_station.ambient_air_quality
音乐播放使用(爱洛婴儿监视器)
# Get the current playback status and available track listbase_station.get_audio_playback_status()# Play a track, optionally specify the track and seek time in secondsbase_station.play_track(track_id='229dca67-7e3c-4a5f-8f43-90e1a9bffc38',position=0)# Pause the currently playing trackbase_station.pause_track()# Skip to the next track in the playlistbase_station.skip_track()# Set the music loop mode to repeat the entire playlistbase_station.set_music_loop_mode_continuous()# Set the music loop mode to repeat the current trackbase_station.set_music_loop_mode_single()# Sets playback to shufflebase_station.set_shuffle_on()# Sets playback to sequentialbase_station.set_shuffle_off()# Change the playback volumebase_station.set_volume(100)
夜间照明使用(爱洛婴儿显示器)
# Turn on the night lightbase_station.set_night_light_on()# Turn off the night lightbase_station.set_night_light_off()# Set the brightness of the night lightbase_station.set_night_light_brightness(200)
支持的设备
如果您有不同的模式,请随时报告您的结果。
Model | Tested by | Status | Results/Issues |
---|---|---|---|
Arlo 1st Generation | @tchellomello | working/ok | N/A |
Arlo 2st Generation | @tchellomello | working/ok | N/A |