arlo 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +16 -2
- data/changelog.md +7 -0
- data/lib/arlo/devices.rb +52 -1
- data/lib/arlo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 311321a69b240b59b379ec90945add8ad6432fb0
|
4
|
+
data.tar.gz: 21467ccf3ca0bd39ae9af7c82cb5c5d8b2ad4297
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec3bed1b5ed9c68341a49298ce22f7b0a53986e65a89a56c96328167b2275657914ec9b1f53d782b2ad3c3be7c4d9d540a064e3870281a43a169f5e2d522da19
|
7
|
+
data.tar.gz: 9a939bc4065ea34346f4138e00b20b479fc8b17607ddb2259a2081ed59eec35b1452871ac3afcb8407ca57e03326dfcab0a368c24ea14a8455edc8d48c599a59
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -104,9 +104,19 @@ camera = @api.get_device_info(camera_name)
|
|
104
104
|
result = @api.take_snapshot(camera)
|
105
105
|
```
|
106
106
|
|
107
|
+
## record_video
|
108
|
+
|
109
|
+
Call this to take a snapshot using a given camera.
|
110
|
+
|
111
|
+
```
|
112
|
+
api = Arlo::API.new
|
113
|
+
camera = @api.get_device_info(camera_name)
|
114
|
+
result = @api.record_video(camera, 10)
|
115
|
+
```
|
116
|
+
|
107
117
|
# TODO
|
108
118
|
|
109
|
-
*
|
119
|
+
* Record and take snapshots asynchronously
|
110
120
|
* Download videos
|
111
121
|
|
112
122
|
# Development
|
@@ -135,4 +145,8 @@ Thank you to [Roberto Gallea](http://www.robertogallea.com/blog/netgear-arlo-api
|
|
135
145
|
|
136
146
|
# Other work
|
137
147
|
|
138
|
-
Whats seems like a very comprehensive Python library by [jeffreydwalter](https://github.com/jeffreydwalter/arlo)
|
148
|
+
Whats seems like a very comprehensive Python library by [jeffreydwalter](https://github.com/jeffreydwalter/arlo)
|
149
|
+
|
150
|
+
# Changelog
|
151
|
+
|
152
|
+
Check out the [changelog](https://github.com/ihassin/arlo/blob/master/changelog.md)
|
data/changelog.md
CHANGED
data/lib/arlo/devices.rb
CHANGED
@@ -58,7 +58,7 @@ module Arlo
|
|
58
58
|
'cameraId': camera_id,
|
59
59
|
'parentId': camera_id,
|
60
60
|
'deviceId': camera_id,
|
61
|
-
'olsonTimeZone': '
|
61
|
+
'olsonTimeZone': camera['properties']['olsonTimeZone']
|
62
62
|
}
|
63
63
|
|
64
64
|
ret_val = post('https://arlo.netgear.com/hmsweb/users/devices/takeSnapshot',
|
@@ -85,5 +85,56 @@ module Arlo
|
|
85
85
|
JSON.parse(ret_val.body)
|
86
86
|
snapshot_ret_val
|
87
87
|
end
|
88
|
+
|
89
|
+
def record_video(camera, duration)
|
90
|
+
camera_id = camera['deviceId']
|
91
|
+
parent_id = camera['parentId']
|
92
|
+
|
93
|
+
payload = {
|
94
|
+
'to': parent_id,
|
95
|
+
'from': 'ArloGem',
|
96
|
+
'resource': "cameras/#{camera_id}",
|
97
|
+
'action': 'set',
|
98
|
+
'responseUrl': '',
|
99
|
+
'publishResponse': true,
|
100
|
+
'transId': SecureRandom.uuid,
|
101
|
+
'properties': {
|
102
|
+
'activityState': 'startUserStream',
|
103
|
+
'cameraId': camera_id
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
ret_val = post('https://arlo.netgear.com/hmsweb/users/devices/startStream',
|
108
|
+
payload, 'xcloudId': camera['xCloudId'])
|
109
|
+
|
110
|
+
ret_val = JSON.parse(ret_val.body)
|
111
|
+
payload = {
|
112
|
+
'xcloudId': camera['xCloudId'],
|
113
|
+
'parentId': camera['parentId'],
|
114
|
+
'deviceId': camera_id,
|
115
|
+
'olsonTimeZone': camera['properties']['olsonTimeZone']
|
116
|
+
|
117
|
+
}
|
118
|
+
|
119
|
+
ret_val = post('https://arlo.netgear.com/hmsweb/users/devices/startRecord',
|
120
|
+
payload, 'xcloudId': camera['xCloudId'])
|
121
|
+
|
122
|
+
JSON.parse(ret_val.body)
|
123
|
+
|
124
|
+
sleep(duration)
|
125
|
+
|
126
|
+
payload = {
|
127
|
+
'xcloudId': camera['xCloudId'],
|
128
|
+
'parentId': camera['parentId'],
|
129
|
+
'deviceId': camera_id,
|
130
|
+
'olsonTimeZone': camera['properties']['olsonTimeZone']
|
131
|
+
|
132
|
+
}
|
133
|
+
|
134
|
+
ret_val = post('https://arlo.netgear.com/hmsweb/users/devices/stopRecord',
|
135
|
+
payload, 'xcloudId': camera['xCloudId'])
|
136
|
+
|
137
|
+
JSON.parse(ret_val.body)
|
138
|
+
end
|
88
139
|
end
|
89
140
|
end
|
data/lib/arlo/version.rb
CHANGED