hue 0.1.4 → 0.1.5

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: 710c4221738dfdb074848e444283c1e7dce6d356
4
- data.tar.gz: c861ca67f30f33986b7a1ede40a368cc71815c3b
3
+ metadata.gz: 392c6116951d5bc531a34f0ef2c52d5fb5f82ad8
4
+ data.tar.gz: 3a5e4de39857bd328c5e69deb2866266d709fcc7
5
5
  SHA512:
6
- metadata.gz: d9571dacb6fdb61edc5255f58610096c30a0fd2a7c5ce9ff66d79638687a48f08aa50251acb9516efb98c30d40aa28b14a1978cb373c194809b4dfe428a0a62f
7
- data.tar.gz: a73d019ab7664247744638dfced2b7cf582d913d05c35b2a96f848ec91ed17fb06e0275ec6d476594f1141d6375879d74dc0552e8db7a6cc1c616d840d3ad2f9
6
+ metadata.gz: e21f6cc541aa058b4a5502f7699f0bb67c46ecf63d07c45c4ea036b037a20ced5372db75cb6d2b9d06fa3796badab290eb2639d3d2084487f9038c09e98899e4
7
+ data.tar.gz: 2d95c4b7a772fbbb966f368f0967ea1d20a9c36b6ee677927a6644548ffde7d93cff812cea376b691f11d72c1180972e31d63bd71e07b0373b1bdb2c0ec5a1f7
@@ -22,6 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_dependency 'thor'
23
23
  spec.add_dependency 'json'
24
24
  spec.add_dependency 'log_switch', '0.4.0'
25
- spec.add_dependency 'playful'
26
25
  spec.add_dependency 'curb'
27
26
  end
@@ -1,11 +1,7 @@
1
1
  require 'net/http'
2
2
  require 'json'
3
- require 'playful/ssdp'
4
3
  require 'curb'
5
4
 
6
- # Playful is super verbose
7
- Playful.log = false
8
-
9
5
  module Hue
10
6
  class Client
11
7
  attr_reader :username
@@ -33,31 +29,16 @@ module Hue
33
29
 
34
30
  def bridges
35
31
  @bridges ||= begin
36
- devices = Playful::SSDP.search 'IpBridge'
37
-
38
- if devices.count == 0
39
- # UPnP failed, lets use N-UPnP
40
- bs = []
41
- easy = Curl::Easy.new
42
- easy.follow_location = true
43
- easy.max_redirects = 10
44
- easy.url = 'https://www.meethue.com/api/nupnp'
45
- easy.perform
46
- JSON(easy.body).each do |hash|
47
- bs << Bridge.new(self, hash)
48
- end
49
- bs
50
- else
51
- devices
52
- .uniq { |d| d[:location] }
53
- .map do |bridge|
54
- Bridge.new(self, {
55
- 'id' => bridge[:usn],
56
- 'name' => bridge[:st],
57
- 'internalipaddress' => URI.parse(bridge[:location]).host
58
- })
59
- end
32
+ bs = []
33
+ easy = Curl::Easy.new
34
+ easy.follow_location = true
35
+ easy.max_redirects = 10
36
+ easy.url = 'https://www.meethue.com/api/nupnp'
37
+ easy.perform
38
+ JSON(easy.body).each do |hash|
39
+ bs << Bridge.new(self, hash)
60
40
  end
41
+ bs
61
42
  end
62
43
  end
63
44
 
@@ -1,3 +1,3 @@
1
1
  module Hue
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Soffes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-25 00:00:00.000000000 Z
11
+ date: 2015-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 0.4.0
55
- - !ruby/object:Gem::Dependency
56
- name: playful
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
55
  - !ruby/object:Gem::Dependency
70
56
  name: curb
71
57
  requirement: !ruby/object:Gem::Requirement