wink_scheduler 0.0.1 → 0.0.2

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: d2f9ba56abb1ab6827e665cbb5b11cb21356c281
4
- data.tar.gz: 236b4cccdf80cab0cee1b2ec79c01855b2bd48cd
3
+ metadata.gz: 801d0b306b4c65b601fc2aeced74759dc63f14c3
4
+ data.tar.gz: 020cb77aa62adbb059bceadaeb282cad0819b458
5
5
  SHA512:
6
- metadata.gz: 0a012a0492b4bccfb4ac650e697b16ecc38f274d7f7c2a182d394fe84129f288ca75b30b78d2ed288208b950a82d409aea921fe9f1aaccbd9243e6ceae0f6e3b
7
- data.tar.gz: ad58f08c43b5dd3812deb501823d24c517df49684ed14f4fe7b1e15a1c1f6ee60e354aa46513dfe05567f195f6bec8a84379442f228bb5f2efb4ced292cc564d
6
+ metadata.gz: ad58b6216cb945341f08618a854e4b603880eedce3f4a76d062fc4950f14fc2589af2489b0fe2aba26f3b195bd43aecb985fd728caf815dd7a398320f34d044d
7
+ data.tar.gz: 1b9fab5079419db65764ccce18b6693c5bca1999fae5f95fe1f5dcbd773f57ac6dbafc990f541220b9a7c6efafe0c267bd7dee6d583ee90e3f83acdbada3fab3
data/Gemfile CHANGED
@@ -2,4 +2,3 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in wink_scheduler.gemspec
4
4
  gemspec
5
- gem 'wink', :git => 'https://github.com/dewski/wink.git'
@@ -1,3 +1,4 @@
1
+ require 'winker'
1
2
  require 'wink_scheduler/schedule'
2
3
 
3
4
  module WinkScheduler
@@ -6,11 +7,17 @@ module WinkScheduler
6
7
  @auth = conf["auth"]
7
8
  @schedules = conf["schedules"]
8
9
 
9
- Wink.configure do |wink|
10
+ Winker.configure do |wink|
10
11
  wink.client_id = @auth["client_id"]
11
12
  wink.client_secret = @auth["client_secret"]
12
13
  wink.access_token = @auth["access_token"]
13
14
  wink.refresh_token = @auth["refresh_token"]
15
+ wink.username = @auth["client_id"]
16
+ wink.password = @auth["client_secret"]
17
+ wink.endpoint = "https://winkapi.quirky.com"
18
+ if wink.respond_to?(:logger)
19
+ wink.logger = nil
20
+ end
14
21
  end
15
22
  end
16
23
 
@@ -18,16 +25,11 @@ module WinkScheduler
18
25
  threads = []
19
26
  @schedules.each do |s|
20
27
  threads << Thread.new do
21
- w = WinkScheduler::Schedule.new(Wink::Client.new, s)
28
+ w = WinkScheduler::Schedule.new(s)
22
29
  w.run
23
30
  end
24
31
  end
25
32
  threads.each {|t| t.join}
26
33
  end
27
-
28
- def test
29
- c = Wink::Client.new
30
- p c.group("All").on
31
- end
32
34
  end
33
35
  end
@@ -1,17 +1,16 @@
1
- require 'wink'
1
+ require 'winker'
2
2
  require 'weather-api'
3
3
  require 'yaml'
4
4
  require 'time'
5
5
 
6
6
  module WinkScheduler
7
7
  class Schedule
8
- def initialize(client, opts)
9
- @client = client
8
+ def initialize(opts)
10
9
  if opts["device"]
11
- @object = client.devices.select { |d| next if d == nil; d.name == opts["device"] }[0]
10
+ @object = Winker.devices.select { |d| next if d == nil; d.name == opts["device"] }[0]
12
11
  @type = :device
13
12
  elsif opts["group"]
14
- @object = client.group(opts["group"])
13
+ @object = Winker.groups.select { |g| next if g == nil; g.name == opts["group"] }[0]
15
14
  @type = :group
16
15
  else
17
16
  raise "device or group not defined"
@@ -1,3 +1,3 @@
1
1
  module WinkScheduler
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "weather-api", "~> 1.2"
22
+ spec.add_dependency "winker", "~> 0.0.14"
22
23
 
23
24
  spec.add_development_dependency "bundler", "~> 1.7"
24
25
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wink_scheduler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Lanford
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-07 00:00:00.000000000 Z
11
+ date: 2015-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: weather-api
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: winker
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 0.0.14
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 0.0.14
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement