arlo 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +11 -1
- data/changelog.md +1 -0
- data/lib/arlo/devices.rb +60 -6
- data/lib/arlo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b667adad1fa2ab948b69b22e5a2d485523785976
|
4
|
+
data.tar.gz: 39bb68118a09ee89f99ce32faabbadc2f07c242d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 435f7d73b99a299070da0ecb00b6e43a5c51aac1162a54698ee4286c83de6a3e9107bd7b4e5c9390cfed7a2b3f09a2ce26031390441e9bd8aa99d20dc7048151
|
7
|
+
data.tar.gz: 18342bd90298a257716f15dec229cebf2d7c59a8a58f8cae5e2ab7063f28767b3e9d61a81c94d0c215906a202e4389a6dd33f352411ea45c7826e8552a295dee
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -94,9 +94,19 @@ api = Arlo::API.new
|
|
94
94
|
library = api.get_library '20180802', '20180803'
|
95
95
|
```
|
96
96
|
|
97
|
+
## take_snapshot
|
98
|
+
|
99
|
+
Call this to take a snapshot using a given camera.
|
100
|
+
|
101
|
+
```
|
102
|
+
api = Arlo::API.new
|
103
|
+
camera = @api.get_device_info(camera_name)
|
104
|
+
result = @api.take_snapshot(camera)
|
105
|
+
```
|
106
|
+
|
97
107
|
# TODO
|
98
108
|
|
99
|
-
* Control cameras (start/stop recordings
|
109
|
+
* Control cameras (start/stop recordings)
|
100
110
|
* Download videos
|
101
111
|
|
102
112
|
# Development
|
data/changelog.md
CHANGED
data/lib/arlo/devices.rb
CHANGED
@@ -12,11 +12,11 @@ module Arlo
|
|
12
12
|
@devices['data'].select {|device| device['deviceName'] == device_name }[0]
|
13
13
|
end
|
14
14
|
|
15
|
-
def arm_device(
|
16
|
-
|
15
|
+
def arm_device(device, armed)
|
16
|
+
device_id = device['deviceId']
|
17
17
|
payload = {
|
18
18
|
'from': 'arlogem',
|
19
|
-
'to':
|
19
|
+
'to': device_id,
|
20
20
|
'action': 'set',
|
21
21
|
'resource': 'modes',
|
22
22
|
'transId': SecureRandom.uuid,
|
@@ -26,10 +26,64 @@ module Arlo
|
|
26
26
|
}
|
27
27
|
}
|
28
28
|
|
29
|
-
ret_val = post("https://arlo.netgear.com/hmsweb/users/devices/notify/#{
|
30
|
-
payload,
|
31
|
-
|
29
|
+
ret_val = post("https://arlo.netgear.com/hmsweb/users/devices/notify/#{device_id}",
|
30
|
+
payload, 'xcloudId': device['xCloudId'])
|
31
|
+
|
32
|
+
JSON.parse(ret_val.body)
|
33
|
+
end
|
34
|
+
|
35
|
+
def take_snapshot(camera)
|
36
|
+
camera_id = camera['deviceId']
|
37
|
+
|
38
|
+
payload = {
|
39
|
+
'to': camera_id,
|
40
|
+
'from': 'ArloGem',
|
41
|
+
'resource': "cameras/#{camera_id}",
|
42
|
+
'action': 'set',
|
43
|
+
'publishResponse': true,
|
44
|
+
'transId': SecureRandom.uuid,
|
45
|
+
'properties': {
|
46
|
+
'activityState': 'startUserStream',
|
47
|
+
'cameraId': camera_id
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
ret_val = post('https://arlo.netgear.com/hmsweb/users/devices/startStream',
|
52
|
+
payload, 'xcloudId': camera['xCloudId'])
|
53
|
+
|
54
|
+
ret_val = JSON.parse(ret_val.body)
|
55
|
+
return ret_val unless ret_val['success']
|
56
|
+
|
57
|
+
payload = {
|
58
|
+
'cameraId': camera_id,
|
59
|
+
'parentId': camera_id,
|
60
|
+
'deviceId': camera_id,
|
61
|
+
'olsonTimeZone': 'Americal/New York'
|
62
|
+
}
|
63
|
+
|
64
|
+
ret_val = post('https://arlo.netgear.com/hmsweb/users/devices/takeSnapshot',
|
65
|
+
payload, 'xcloudId': camera['xCloudId'])
|
66
|
+
|
67
|
+
snapshot_ret_val = JSON.parse(ret_val.body)
|
68
|
+
|
69
|
+
payload = {
|
70
|
+
'to': camera_id,
|
71
|
+
'from': 'ArloGem',
|
72
|
+
'resource': "cameras/#{camera_id}",
|
73
|
+
'action': 'set',
|
74
|
+
'publishResponse': true,
|
75
|
+
'transId': SecureRandom.uuid,
|
76
|
+
'properties': {
|
77
|
+
'activityState': 'stopUserStream',
|
78
|
+
'cameraId': camera_id
|
79
|
+
}
|
80
|
+
}
|
81
|
+
|
82
|
+
ret_val = post('https://arlo.netgear.com/hmsweb/users/devices/stopStream',
|
83
|
+
payload, 'xcloudId': camera['xCloudId'])
|
84
|
+
|
32
85
|
JSON.parse(ret_val.body)
|
86
|
+
snapshot_ret_val
|
33
87
|
end
|
34
88
|
end
|
35
89
|
end
|
data/lib/arlo/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arlo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Itamar Hassin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-08-
|
11
|
+
date: 2018-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|