saj_collector 0.5.0 → 0.5.1

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
  SHA256:
3
- metadata.gz: 3cd6cde289ad4c8172d81fe8328aaed9d80739b034e373e76b2a84e3d7378fad
4
- data.tar.gz: c6c71fc42fe81350dcbf3edaf7f9e26c02f90b07f412340702d3ecaa830d2806
3
+ metadata.gz: aadd3eb567df88df560c127500d33875d0b39f8dbed4728dc58812034c6471d3
4
+ data.tar.gz: 10d9fbb5e8151cb7e44963ca4fb1d156e6b44bed4ba224677e2eba4611a39499
5
5
  SHA512:
6
- metadata.gz: ba424ce76bf030ff3afb5ba7a4e300e8934ae8086f237e1f933ffbd92a449c953e594c31a374ddd45dd3e232b6001069ef42199f2b03adb3604ccf176203bd26
7
- data.tar.gz: f3a2a0145efc2ea370e73353907b59e59a32f3d4caec503b005d322ffa92141e5b855d6459679cbe5eeaeccd8a615ccacab351da8613ae596e119358f50f65b7
6
+ metadata.gz: 62c56c6a9bf49fd761bf16c74fc985fcb1717659d08b17b99db47264c90bcfd105d18a1376f09ce15379b216fbc64af7edc3233352907023daa9cb61b396cb5b
7
+ data.tar.gz: c340d3fc7171eac32cfb9c7fd6dfb0854401896f57fde87032e53dbc5f0b05bd51c638da478eb4a02fbae20a6b6f2ea22ba6b80a1f9cd1e2027b016e13624044
data/exe/saj_collector CHANGED
@@ -21,7 +21,7 @@ options = {
21
21
  'power_today' => 0,
22
22
  'power_all_time' => 0,
23
23
  'runtime_today' => 0,
24
- 'runtime_all_time' => 0,
24
+ 'runtime_all_time' => 0
25
25
  }
26
26
 
27
27
  # Get the current realtime data from the SAJ device
@@ -31,40 +31,40 @@ c = Net::HTTP.get(sajcollector_config[:saj], '/real_time_data.xml')
31
31
  doc = REXML::Document.new c
32
32
 
33
33
  # Get the temperature
34
- doc.elements.each('real_time_data/temp'){
35
- |e| options[:temperature] = e.text
34
+ doc.elements.each('real_time_data/temp') { |e|
35
+ options[:temperature] = e.text
36
36
  }
37
37
 
38
38
  # e-today is in kWh where pvoutput is Wh
39
- doc.elements.each('real_time_data/e-today'){
40
- |e| options[:energy_generated] = e.text.to_f * 1000
39
+ doc.elements.each('real_time_data/e-today') { |e|
40
+ options[:energy_generated] = e.text.to_f * 1000
41
41
  }
42
42
 
43
43
  # Get the power generated
44
- doc.elements.each('real_time_data/p-ac'){
45
- |e| options[:power_generated] = e.text
44
+ doc.elements.each('real_time_data/p-ac') { |e|
45
+ options[:power_generated] = e.text
46
46
  }
47
47
 
48
48
  # Get the current amperage
49
- doc.elements.each('real_time_data/i-grid'){
50
- |e| options[:amperage] = e.text
49
+ doc.elements.each('real_time_data/i-grid') { |e|
50
+ options[:amperage] = e.text
51
51
  }
52
52
 
53
53
  # Get the voltage
54
- doc.elements.each('real_time_data/v-grid'){
55
- |e| options[:voltage] = e.text
54
+ doc.elements.each('real_time_data/v-grid') { |e|
55
+ options[:voltage] = e.text
56
56
  }
57
- doc.elements.each('real_time_data/e-today'){
58
- |e| options[:power_today] = e.text
57
+ doc.elements.each('real_time_data/e-today') { |e|
58
+ options[:power_today] = e.text
59
59
  }
60
- doc.elements.each('real_time_data/e-total'){
61
- |e| options[:power_all_time] = e.text
60
+ doc.elements.each('real_time_data/e-total') { |e|
61
+ options[:power_all_time] = e.text
62
62
  }
63
- doc.elements.each('real_time_data/t-today'){
64
- |e| options[:runtime_today] = e.text
63
+ doc.elements.each('real_time_data/t-today') { |e|
64
+ options[:runtime_today] = e.text
65
65
  }
66
- doc.elements.each('real_time_data/t-total'){
67
- |e| options[:runtime_all_time] = e.text
66
+ doc.elements.each('real_time_data/t-total') { |e|
67
+ options[:runtime_all_time] = e.text
68
68
  }
69
69
 
70
70
  puts '-------------------------'
@@ -34,16 +34,17 @@ day_trend_multiplication = 100
34
34
 
35
35
  # Some SAJ Inverters provide they energy_generated in granularity of 0.1kWh and
36
36
  # others in 0.01kWh.
37
- if !sajcollector_config[:day_trend_multiplication_factor].nil?
38
- day_trend_multiplication = sajcollector_config[:day_trend_multiplication_factor].to_i
37
+ unless sajcollector_config[:day_trend_multiplication_factor].nil?
38
+ day_trend_multiplication = sajcollector_config[:day_trend_multiplication_factor].to_i
39
39
  end
40
40
 
41
41
  while counter < days
42
42
  value = {
43
- :energy_generated => 0 }
43
+ :energy_generated => 0
44
+ }
44
45
  # Get the power output of the day,
45
- doc.elements.each("day_trend/d#{counter}"){
46
- |e| value[:energy_generated] = (e.text.to_i * day_trend_multiplication).to_s
46
+ doc.elements.each("day_trend/d#{counter}") { |e|
47
+ value[:energy_generated] = (e.text.to_i * day_trend_multiplication).to_s
47
48
  }
48
49
  options[:"#{m}#{current_day.next!}"] = value
49
50
 
@@ -1,3 +1,3 @@
1
1
  module SAJCollector
2
- VERSION = '0.5.0'.freeze
2
+ VERSION = '0.5.1'.freeze
3
3
  end
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  lib = File.expand_path('../lib', __FILE__)
3
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
3
  require 'saj_collector/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saj_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johnny Willemsen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-12-27 00:00:00.000000000 Z
11
+ date: 2018-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pvoutput