enimo_client 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/enimo_client.gemspec +2 -0
- data/lib/enimo_client/version.rb +1 -1
- data/lib/enimo_client.rb +15 -14
- metadata +36 -8
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YzYwOTJjYzBlYWE0ODZiZTExMjRjOTg0ZjhjYTY2ZDI2MDdkY2RkNw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Y2ZkZWE0Y2E0MzA2MjhiNzllMjhkMjRkYmFkMTE3MWE3YjgzNGZlOA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YjZlMTAxMTY2YWI5YzZjZThiYWY5OTFiOTFhZTNjYWFkYjA4OTVkNzQzMGEx
|
10
|
+
YWMyZGY4YmY0MGU5YzQwNzdiYWVjN2M0YjEzMDAyMTNkMTg1ZDI3ZjNjNmQ3
|
11
|
+
NDA3MWI5NjRlNGE2MWU3MzgzMTc5NmY5ZTFiM2RlNmEzOGVkZjQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NDhhNjI1ZGQ1MDA5YWRmNDc2MzdhNzg2N2M2MzY2N2IxMzg1YTNkOTQ0MmYx
|
14
|
+
YmY0OTM5ZTUwNTcyODFiMjUwZjRmODYxNGIwY2FhMmMwYTdlMjk4ODViNWU0
|
15
|
+
YWE5NmJmZGY1ZjcwMmUxNGM5ZmIyYzkyOTI4ODQ1N2M1MDU1NGU=
|
data/enimo_client.gemspec
CHANGED
data/lib/enimo_client/version.rb
CHANGED
data/lib/enimo_client.rb
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
require "./enimo_client/version"
|
2
|
-
require "/enimo_client/version"
|
3
|
-
|
4
1
|
require 'httparty'
|
5
2
|
require 'pry'
|
3
|
+
|
6
4
|
module EnimoClient
|
7
5
|
class API
|
8
6
|
|
9
7
|
def start(session)
|
8
|
+
prod = "ec2-54-186-158-25.us-west-2.compute.amazonaws.com"
|
9
|
+
dev = "localhost:3000"
|
10
|
+
@domain = prod
|
10
11
|
if session[:device_id].nil? or session[:action].nil?
|
11
12
|
return "You must include the session details. please read the documentation for more info."
|
12
13
|
else
|
@@ -25,40 +26,40 @@ module EnimoClient
|
|
25
26
|
end
|
26
27
|
|
27
28
|
def add_device(device_id)
|
28
|
-
response = HTTParty.get("http
|
29
|
+
response = HTTParty.get("http://#{@domain}/devices/#{device_id}/new")
|
29
30
|
puts response.body, response.code, response.message, response.headers.inspect
|
30
31
|
end
|
31
32
|
|
32
33
|
def debug_alert(device_id)
|
33
|
-
HTTParty.get("http
|
34
|
+
HTTParty.get("http://#{@domain}/devices/#{device_id}/on")
|
34
35
|
sleep 2
|
35
|
-
HTTParty.get("http
|
36
|
+
HTTParty.get("http://#{@domain}/devices/#{device_id}/off")
|
36
37
|
end
|
37
38
|
|
38
39
|
def important_alert(device_id)
|
39
|
-
HTTParty.get("http
|
40
|
+
HTTParty.get("http://#{@domain}/devices/#{device_id}/on")
|
40
41
|
sleep 2
|
41
|
-
HTTParty.get("http
|
42
|
+
HTTParty.get("http://#{@domain}/devices/#{device_id}/off")
|
42
43
|
end
|
43
44
|
|
44
45
|
def turn_on(device_id)
|
45
|
-
HTTParty.get("http
|
46
|
+
HTTParty.get("http://#{@domain}/devices/#{device_id}/on")
|
46
47
|
end
|
47
48
|
|
48
49
|
def turn_off(device_id)
|
49
|
-
HTTParty.get("http
|
50
|
+
HTTParty.get("http://#{@domain}/devices/#{device_id}/off")
|
50
51
|
end
|
51
52
|
|
52
53
|
def simple_alert(device_id)
|
53
|
-
HTTParty.get("http
|
54
|
+
HTTParty.get("http://#{@domain}/devices/#{device_id}/on")
|
54
55
|
sleep 1.5
|
55
|
-
HTTParty.get("http
|
56
|
+
HTTParty.get("http://#{@domain}/devices/#{device_id}/off")
|
56
57
|
end
|
57
58
|
|
58
59
|
def phone_call_alert(device_id)
|
59
|
-
HTTParty.get("http
|
60
|
+
HTTParty.get("http://#{@domain}/devices/#{device_id}/on")
|
60
61
|
sleep 15
|
61
|
-
HTTParty.get("http
|
62
|
+
HTTParty.get("http://#{@domain}/devices/#{device_id}/off")
|
62
63
|
end
|
63
64
|
|
64
65
|
def flash(device_id,alert_type)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enimo_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ori Wwininger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,17 +28,45 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - '>='
|
31
|
+
- - ! '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - '>='
|
38
|
+
- - ! '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: httparty
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: pry
|
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'
|
69
|
+
description: ! ' Write a longer description. Optional.'
|
42
70
|
email:
|
43
71
|
- oriwininger0@gmail.com
|
44
72
|
executables: []
|
@@ -63,17 +91,17 @@ require_paths:
|
|
63
91
|
- lib
|
64
92
|
required_ruby_version: !ruby/object:Gem::Requirement
|
65
93
|
requirements:
|
66
|
-
- - '>='
|
94
|
+
- - ! '>='
|
67
95
|
- !ruby/object:Gem::Version
|
68
96
|
version: '0'
|
69
97
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
98
|
requirements:
|
71
|
-
- - '>='
|
99
|
+
- - ! '>='
|
72
100
|
- !ruby/object:Gem::Version
|
73
101
|
version: '0'
|
74
102
|
requirements: []
|
75
103
|
rubyforge_project:
|
76
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.2.2
|
77
105
|
signing_key:
|
78
106
|
specification_version: 4
|
79
107
|
summary: Gem for enimo box
|