wh2600 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/wh2600.rb +3 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b031dbcd6b4ac91658daddc4910bcb7bb849ce94
4
- data.tar.gz: a6e3d39533e6dad934fe8a350a46ae05d21d9e8a
3
+ metadata.gz: 82cfe0f175d0f030dde4178008d31a0a4defd4c1
4
+ data.tar.gz: 7da0532dad68d130740e5d1b1c1998c40c7cd66e
5
5
  SHA512:
6
- metadata.gz: 700395c59ab06f94b43762a46575f7650f1c36b13777aa9834b88a347179c50c108b636afc716141f99c85e8e8988ac2bbcfdf3794c339bdcb4f0ab7068eb3da
7
- data.tar.gz: 262280616223ff54f9ceace5d222f739d992f0315ccd61dd68659377e9028d4669bc5d988ec8376b1128ff27bf275a9994dbf364801adbe86150a6d61ed2b68d
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')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wh2600
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Krunoslav Husak