wh2600 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wh2600.rb +3 -2
- 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: 82cfe0f175d0f030dde4178008d31a0a4defd4c1
|
4
|
+
data.tar.gz: 7da0532dad68d130740e5d1b1c1998c40c7cd66e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96faaa5016d449da7e79287d14660a400ec0acff62a30fd2ff0798c9ba25a03911595146875fcc0ea198138cc2af46a2c9e7f9f83b827b26081b33acc738f4cd
|
7
|
+
data.tar.gz: 8fc6eb3186896b42adb8af2e32129dc3a2696945f0458b7db5a2e40938acbf596c9af592ce4035687b00e1fa1359c97fdec728a9db4ff1063547e29237ced9a9
|
data/lib/wh2600.rb
CHANGED
@@ -2,14 +2,15 @@ require 'nokogiri'
|
|
2
2
|
require 'open-uri'
|
3
3
|
|
4
4
|
class Wh2600
|
5
|
-
def initialize(ip_address)
|
5
|
+
def initialize(ip_address, time_zone='CET')
|
6
6
|
@ip_address = ip_address
|
7
|
+
@time_zone = time_zone
|
7
8
|
end
|
8
9
|
|
9
10
|
def get_data(live_data_uri='livedata.htm')
|
10
11
|
data = {}
|
11
12
|
data_html = Nokogiri::HTML(open_page(live_data_uri))
|
12
|
-
data['receiver_datetime'] = DateTime.strptime(data_html.at_xpath('//input[@name="CurrTime"]')['value'], '%H:%M %m/%d/%Y')
|
13
|
+
data['receiver_datetime'] = DateTime.strptime(data_html.at_xpath('//input[@name="CurrTime"]')['value'] << @time_zone , '%H:%M %m/%d/%Y%Z')
|
13
14
|
data['sensors'] = {}
|
14
15
|
data['sensors']['indoor_id'] = data_html.at_xpath('//input[@name="IndoorID"]').attr('value')
|
15
16
|
data['sensors']['outdoor1_id'] = data_html.at_xpath('//input[@name="Outdoor1ID"]').attr('value')
|