arlo 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b667adad1fa2ab948b69b22e5a2d485523785976
4
- data.tar.gz: 39bb68118a09ee89f99ce32faabbadc2f07c242d
3
+ metadata.gz: 311321a69b240b59b379ec90945add8ad6432fb0
4
+ data.tar.gz: 21467ccf3ca0bd39ae9af7c82cb5c5d8b2ad4297
5
5
  SHA512:
6
- metadata.gz: 435f7d73b99a299070da0ecb00b6e43a5c51aac1162a54698ee4286c83de6a3e9107bd7b4e5c9390cfed7a2b3f09a2ce26031390441e9bd8aa99d20dc7048151
7
- data.tar.gz: 18342bd90298a257716f15dec229cebf2d7c59a8a58f8cae5e2ab7063f28767b3e9d61a81c94d0c215906a202e4389a6dd33f352411ea45c7826e8552a295dee
6
+ metadata.gz: ec3bed1b5ed9c68341a49298ce22f7b0a53986e65a89a56c96328167b2275657914ec9b1f53d782b2ad3c3be7c4d9d540a064e3870281a43a169f5e2d522da19
7
+ data.tar.gz: 9a939bc4065ea34346f4138e00b20b479fc8b17607ddb2259a2081ed59eec35b1452871ac3afcb8407ca57e03326dfcab0a368c24ea14a8455edc8d48c599a59
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- arlo (0.0.5)
4
+ arlo (0.0.6)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
- * Control cameras (start/stop recordings)
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)
@@ -13,3 +13,10 @@
13
13
  * Devices and Profile are loaded when API object is created
14
14
  * Added arm/disarm API method
15
15
  * Added API to take a snapshot
16
+
17
+ ## 2018-08-06
18
+
19
+ ### Non-breaking
20
+
21
+ * Added API to record video from a given camera
22
+
@@ -58,7 +58,7 @@ module Arlo
58
58
  'cameraId': camera_id,
59
59
  'parentId': camera_id,
60
60
  'deviceId': camera_id,
61
- 'olsonTimeZone': 'Americal/New York'
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
@@ -1,3 +1,3 @@
1
1
  module Arlo
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arlo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Itamar Hassin