huemote 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/huemote.rb +2 -2
- data/lib/huemote/bridge.rb +6 -4
- data/lib/huemote/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9010083d38b18502ddbc4578899fcf199db83ee8
|
4
|
+
data.tar.gz: c0e2fc0f6a9b6fb9374ec0cd098c69f0b89c55b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9efec171e29f6b5b3ea924a5d78a85602fd5f184d07a5953621fcf4b94d4c16063b517f972266be2f07e7c4c31a75f72d094656b41cc2373184d6f52dafdd80d
|
7
|
+
data.tar.gz: c359dc6e8424663a8cd5b5fcbd838ab37d1a1f8770f87782d3327d5fdab25ed2fc1b4d8beb6c39c3e7cc3dff5a6dc8b6d82c3b93e19b2ac6435393ee5283b887
|
data/lib/huemote.rb
CHANGED
data/lib/huemote/bridge.rb
CHANGED
@@ -4,7 +4,8 @@ require 'ipaddr'
|
|
4
4
|
module Huemote
|
5
5
|
class Bridge
|
6
6
|
DEVICE_TYPE = "Huemote"
|
7
|
-
|
7
|
+
GOOGLE_IP = "64.233.187.99"
|
8
|
+
USERNAME = "HuemoteRubyGem"
|
8
9
|
|
9
10
|
class << self
|
10
11
|
def get
|
@@ -13,10 +14,11 @@ module Huemote
|
|
13
14
|
|
14
15
|
private
|
15
16
|
|
16
|
-
def discover
|
17
|
+
def discover
|
17
18
|
client = Huemote::Client.new
|
18
|
-
|
19
|
-
|
19
|
+
ip = UDPSocket.open {|s| s.connect(GOOGLE_IP, 1); s.addr.last}
|
20
|
+
device = `nmap -sP #{ip.split('.')[0..-2].join('.')}.* > /dev/null && arp -na | grep 0:17:88`.split("\n")[0]
|
21
|
+
host = /\((\d+\.\d+\.\d+\.\d+)\)/.match(device)[1]
|
20
22
|
|
21
23
|
body = client.get("http://#{host}:80/description.xml").body
|
22
24
|
|
data/lib/huemote/version.rb
CHANGED