botvac 0.1.0 → 0.1.2
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/README.md +8 -13
- data/bin/botvac +5 -0
- data/botvac.gemspec +1 -0
- data/lib/botvac/cli.rb +40 -0
- data/lib/botvac/version.rb +1 -1
- metadata +20 -4
- data/Gemfile.lock +0 -94
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86fd04989330c9cdb7f86a0d474f41a10346181e
|
4
|
+
data.tar.gz: b0ab1f04691b7f1e9210dd592597a44dd5a2aea3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ba5a8904b028e33040ed43fdb8c2d36dae72e79a95b080670df476215fef106bf64ed2fbd4a4719bc00f499bfa8f4014d8beaaca9d1fcf89b4843742fbc760b
|
7
|
+
data.tar.gz: a55a0ed3ea884139b723666b89992e4f0930198d36fe3aee894836c176fbfaa056ee1899c10868313944d81a9a5252fca4d6db4825c6ef57cbb5b586c639cfea
|
data/README.md
CHANGED
@@ -23,24 +23,19 @@ Add the gem into your project using `bundler`
|
|
23
23
|
### Creating a new robot
|
24
24
|
|
25
25
|
In order to crate a new robot, you'll need to figure out
|
26
|
-
the correct serial
|
26
|
+
the correct serial and the associated secret.
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
Once the gem is installed you should have a binary
|
29
|
+
named `botvac` which allow you to do so:
|
30
30
|
|
31
|
-
|
32
|
-
cumbersome, as it requires you to sniff the traffic between
|
33
|
-
you smartphone and the neato servers. Looks out for a
|
34
|
-
request to
|
31
|
+
$ botvac robots
|
35
32
|
|
36
|
-
|
33
|
+
Email: foo@example.com
|
34
|
+
Password:
|
37
35
|
|
38
|
-
|
36
|
+
Robot (BotVacConnected) => Serial: OPSXXXX-XXXXX Secret: XXXXXXXX
|
39
37
|
|
40
|
-
|
41
|
-
future versions.
|
42
|
-
|
43
|
-
Once you have the serial and secret create a new robot object
|
38
|
+
Save these somewhere, so you can use them later to create a new robot object!
|
44
39
|
|
45
40
|
mrrobot = Botvac::Robot.new(<serial>, <secret>)
|
46
41
|
|
data/bin/botvac
ADDED
data/botvac.gemspec
CHANGED
@@ -26,6 +26,7 @@ application.
|
|
26
26
|
spec.add_dependency "faraday"
|
27
27
|
spec.add_dependency "faraday_middleware"
|
28
28
|
spec.add_dependency "rack"
|
29
|
+
spec.add_dependency "thor"
|
29
30
|
|
30
31
|
spec.add_development_dependency "bundler", ">= 1.6.2"
|
31
32
|
spec.add_development_dependency "rake", "~> 10.0"
|
data/lib/botvac/cli.rb
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'thor'
|
2
|
+
require 'botvac'
|
3
|
+
require 'securerandom'
|
4
|
+
|
5
|
+
module Botvac
|
6
|
+
class Cli < Thor
|
7
|
+
ENDPOINT = 'https://beehive.neatocloud.com/'
|
8
|
+
|
9
|
+
attr_accessor :token
|
10
|
+
|
11
|
+
desc 'login', 'login into neato cloudservices'
|
12
|
+
def login
|
13
|
+
email = ask("Email:").to_s
|
14
|
+
password = ask("Pasword:", echo: false).to_s
|
15
|
+
|
16
|
+
self.token = connection.post('/sessions', { platform: "ios", email: email, token: SecureRandom.hex(32), password: password }).body['access_token']
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "robots", "fetch details about you registered robots"
|
20
|
+
def robots
|
21
|
+
login unless token
|
22
|
+
puts ''
|
23
|
+
connection.get('/dashboard').body['robots'].each do |bot|
|
24
|
+
puts "#{bot['name']} (#{bot['model']}) => Serial: #{bot['serial']} Secret: #{bot['secret_key']}"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
no_commands do
|
29
|
+
def connection
|
30
|
+
Faraday.new(ENDPOINT) do |faraday|
|
31
|
+
faraday.response :json
|
32
|
+
faraday.request :json
|
33
|
+
faraday.headers["Accept"]= 'application/vnd.neato.nucleo.v1'
|
34
|
+
faraday.headers["Authorization"]= "Token token=#{token}" if token
|
35
|
+
faraday.adapter Faraday.default_adapter
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/botvac/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: botvac
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lars Brillert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: thor
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: bundler
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,20 +170,22 @@ description: |
|
|
156
170
|
application.
|
157
171
|
email:
|
158
172
|
- lars@railslove.com
|
159
|
-
executables:
|
173
|
+
executables:
|
174
|
+
- botvac
|
160
175
|
extensions: []
|
161
176
|
extra_rdoc_files: []
|
162
177
|
files:
|
163
178
|
- ".gitignore"
|
164
179
|
- Gemfile
|
165
|
-
- Gemfile.lock
|
166
180
|
- Guardfile
|
167
181
|
- LICENSE.txt
|
168
182
|
- README.md
|
169
183
|
- Rakefile
|
184
|
+
- bin/botvac
|
170
185
|
- botvac.gemspec
|
171
186
|
- cert/neatocloud.com.crt
|
172
187
|
- lib/botvac.rb
|
188
|
+
- lib/botvac/cli.rb
|
173
189
|
- lib/botvac/robot.rb
|
174
190
|
- lib/botvac/version.rb
|
175
191
|
- lib/botvac/web.rb
|
data/Gemfile.lock
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
botvac (0.1.0)
|
5
|
-
faraday
|
6
|
-
faraday_middleware
|
7
|
-
rack
|
8
|
-
|
9
|
-
GEM
|
10
|
-
remote: https://rubygems.org/
|
11
|
-
specs:
|
12
|
-
addressable (2.4.0)
|
13
|
-
coderay (1.1.0)
|
14
|
-
crack (0.4.2)
|
15
|
-
safe_yaml (~> 1.0.0)
|
16
|
-
diff-lcs (1.2.5)
|
17
|
-
faraday (0.9.2)
|
18
|
-
multipart-post (>= 1.2, < 3)
|
19
|
-
faraday_middleware (0.10.0)
|
20
|
-
faraday (>= 0.7.4, < 0.10)
|
21
|
-
ffi (1.9.10)
|
22
|
-
formatador (0.2.5)
|
23
|
-
guard (2.13.0)
|
24
|
-
formatador (>= 0.2.4)
|
25
|
-
listen (>= 2.7, <= 4.0)
|
26
|
-
lumberjack (~> 1.0)
|
27
|
-
nenv (~> 0.1)
|
28
|
-
notiffany (~> 0.0)
|
29
|
-
pry (>= 0.9.12)
|
30
|
-
shellany (~> 0.0)
|
31
|
-
thor (>= 0.18.1)
|
32
|
-
guard-compat (1.2.1)
|
33
|
-
guard-rspec (4.6.4)
|
34
|
-
guard (~> 2.1)
|
35
|
-
guard-compat (~> 1.1)
|
36
|
-
rspec (>= 2.99.0, < 4.0)
|
37
|
-
hashdiff (0.2.3)
|
38
|
-
listen (3.0.5)
|
39
|
-
rb-fsevent (>= 0.9.3)
|
40
|
-
rb-inotify (>= 0.9)
|
41
|
-
lumberjack (1.0.10)
|
42
|
-
method_source (0.8.2)
|
43
|
-
multipart-post (2.0.0)
|
44
|
-
nenv (0.2.0)
|
45
|
-
notiffany (0.0.8)
|
46
|
-
nenv (~> 0.1)
|
47
|
-
shellany (~> 0.0)
|
48
|
-
pry (0.10.3)
|
49
|
-
coderay (~> 1.1.0)
|
50
|
-
method_source (~> 0.8.1)
|
51
|
-
slop (~> 3.4)
|
52
|
-
rack (1.6.4)
|
53
|
-
rake (10.5.0)
|
54
|
-
rb-fsevent (0.9.7)
|
55
|
-
rb-inotify (0.9.5)
|
56
|
-
ffi (>= 0.5.0)
|
57
|
-
rspec (3.4.0)
|
58
|
-
rspec-core (~> 3.4.0)
|
59
|
-
rspec-expectations (~> 3.4.0)
|
60
|
-
rspec-mocks (~> 3.4.0)
|
61
|
-
rspec-core (3.4.1)
|
62
|
-
rspec-support (~> 3.4.0)
|
63
|
-
rspec-expectations (3.4.0)
|
64
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
-
rspec-support (~> 3.4.0)
|
66
|
-
rspec-mocks (3.4.1)
|
67
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
68
|
-
rspec-support (~> 3.4.0)
|
69
|
-
rspec-support (3.4.1)
|
70
|
-
safe_yaml (1.0.4)
|
71
|
-
shellany (0.0.1)
|
72
|
-
slop (3.6.0)
|
73
|
-
thor (0.19.1)
|
74
|
-
timecop (0.8.0)
|
75
|
-
webmock (1.22.3)
|
76
|
-
addressable (>= 2.3.6)
|
77
|
-
crack (>= 0.3.2)
|
78
|
-
hashdiff
|
79
|
-
|
80
|
-
PLATFORMS
|
81
|
-
ruby
|
82
|
-
|
83
|
-
DEPENDENCIES
|
84
|
-
botvac!
|
85
|
-
bundler (>= 1.6.2)
|
86
|
-
guard-rspec
|
87
|
-
pry
|
88
|
-
rake (~> 10.0)
|
89
|
-
rspec
|
90
|
-
timecop
|
91
|
-
webmock
|
92
|
-
|
93
|
-
BUNDLED WITH
|
94
|
-
1.11.2
|