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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ade891c4682adec3edc24e9c211c989ca1175268
4
- data.tar.gz: 331ef19377d698de633fc45ba05bda9d99cb634e
3
+ metadata.gz: fb8830fa21d5e89f783637e3054c565381e3d6b7
4
+ data.tar.gz: c576014ef7919633c93268bb578b21d5762560d8
5
5
  SHA512:
6
- metadata.gz: bab793b9c88414e516ef2bdef9e11e05571d147eb113b80e3b5d5618df5bb5bd50f356d2264255132e55ef2035ec9f96321a4ba74d40e798ce43e1ea954bc178
7
- data.tar.gz: 353090b39beaadccf2d55f02bdc5eb0d626d3dde5ad139dc4b92aba3a68ec2ebb05674ecc8b9625087ac6f6e5f387af4867e88c993076c9ece0f06f7fcaf9b8b
6
+ metadata.gz: 402837b989124f05e502a18d5e371e8f7d4cf4414c3c4db5a219b6afa4ede0aeb303998c0eadfad707728c9e6320a9a932dc8a19f9926ba28e2d187b1c5567f8
7
+ data.tar.gz: 88af93279e7e53570a429e1fc0ed34ef659ede3b7ae2379407d6cc049216f8e877d9dfbcc0aee8126c9f73ec20a4fde05cb0b91a84a6683b78157a45f6bed9ce
@@ -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
@@ -5,4 +5,5 @@ end
5
5
 
6
6
 
7
7
  require "winker_ai/version"
8
- require "winker_ai/triggers"
8
+ require "winker_ai/triggers"
9
+ require "winker_ai/http_server"
@@ -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
@@ -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?
@@ -1,3 +1,3 @@
1
1
  module WinkerAI
2
- VERSION = "0.0.01"
2
+ VERSION = "0.0.02"
3
3
  end
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.01
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-08 00:00:00.000000000 Z
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