WinkerAI 0.0.01 → 0.0.02
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/winker_ai_start +1 -9
- data/lib/winker_ai.rb +2 -1
- data/lib/winker_ai/http_server.rb +16 -0
- data/lib/winker_ai/triggers.rb +1 -0
- data/lib/winker_ai/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb8830fa21d5e89f783637e3054c565381e3d6b7
|
4
|
+
data.tar.gz: c576014ef7919633c93268bb578b21d5762560d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 402837b989124f05e502a18d5e371e8f7d4cf4414c3c4db5a219b6afa4ede0aeb303998c0eadfad707728c9e6320a9a932dc8a19f9926ba28e2d187b1c5567f8
|
7
|
+
data.tar.gz: 88af93279e7e53570a429e1fc0ed34ef659ede3b7ae2379407d6cc049216f8e877d9dfbcc0aee8126c9f73ec20a4fde05cb0b91a84a6683b78157a45f6bed9ce
|
data/bin/winker_ai_start
CHANGED
@@ -5,13 +5,5 @@ require 'winker_ai'
|
|
5
5
|
require 'sinatra'
|
6
6
|
|
7
7
|
#start up sinatra listener
|
8
|
+
WinkerAI::HttpServer.run!
|
8
9
|
|
9
|
-
WinkerAI.setup
|
10
|
-
|
11
|
-
get '/command' do
|
12
|
-
# matches "GET /hello/foo" and "GET /hello/bar"
|
13
|
-
# params['name'] is 'foo' or 'bar'
|
14
|
-
puts params[:q]
|
15
|
-
WinkerAI.check_for_trigger(params[:q])
|
16
|
-
"success"
|
17
|
-
end
|
data/lib/winker_ai.rb
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'sinatra'
|
2
|
+
module WinkerAI
|
3
|
+
class HttpServer < Sinatra::Base
|
4
|
+
|
5
|
+
WinkerAI.setup
|
6
|
+
|
7
|
+
get '/command' do
|
8
|
+
# matches "GET /hello/foo" and "GET /hello/bar"
|
9
|
+
# params['name'] is 'foo' or 'bar'
|
10
|
+
puts params[:q]
|
11
|
+
WinkerAI.check_for_trigger(params[:q])
|
12
|
+
"success"
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|
data/lib/winker_ai/triggers.rb
CHANGED
@@ -85,6 +85,7 @@ module WinkerAI
|
|
85
85
|
when number && string.match(/(#{LIGHT_TRIGGERS.join("|")})/) && !devices.empty?
|
86
86
|
puts "case 1"
|
87
87
|
devices.each do |d|
|
88
|
+
puts "brightness: #{d.name} #{number}"
|
88
89
|
d.brightness = number/100.0
|
89
90
|
end
|
90
91
|
when !number && (_match1 = string.match(/(#{LIGHT_TRIGGERS.join("|")})/)[1]) && !devices.empty?
|
data/lib/winker_ai/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: WinkerAI
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.02
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kelly Mahan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- bin/winker_ai_start
|
84
84
|
- lib/winker_ai.rb
|
85
85
|
- lib/winker_ai/hash.rb
|
86
|
+
- lib/winker_ai/http_server.rb
|
86
87
|
- lib/winker_ai/triggers.rb
|
87
88
|
- lib/winker_ai/version.rb
|
88
89
|
- winker_ai.gemspec
|