Skip to content

Commit

Permalink
Merge pull request #52 from Siphonay/no-curb
Browse files Browse the repository at this point in the history
Remove curb dependency
  • Loading branch information
soffes authored Jan 3, 2024
2 parents fc8d9b9 + 6629d29 commit 6414427
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion hue.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'thor'
spec.add_dependency 'json'
spec.add_dependency 'log_switch', '0.4.0'
spec.add_dependency 'curb'
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'webmock'
end
11 changes: 4 additions & 7 deletions lib/hue/client.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'net/http'
require 'json'
require 'resolv'
require 'curb'

module Hue
class Client
Expand Down Expand Up @@ -145,12 +144,10 @@ def discovery_mdns(bs)
end

def discovery_meethue(bs)
easy = Curl::Easy.new
easy.follow_location = true
easy.max_redirects = 10
easy.url = 'https://discovery.meethue.com/'
easy.perform
JSON(easy.body).each do |hash|
uri = URI('https://discovery.meethue.com/')
response = Net::HTTP.get(uri)

JSON(response).each do |hash|
bs << Bridge.new(self, hash)
end
end
Expand Down

0 comments on commit 6414427

Please sign in to comment.