saj_collector 0.5.1 → 0.5.2

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: aadd3eb567df88df560c127500d33875d0b39f8dbed4728dc58812034c6471d3
4
- data.tar.gz: 10d9fbb5e8151cb7e44963ca4fb1d156e6b44bed4ba224677e2eba4611a39499
3
+ metadata.gz: 7c1f47dd27e1e93a45287ea5d5f0ed689cc4f3d3450bf0c53af032bc4836c2b0
4
+ data.tar.gz: afaeb38f25bea2870db7e3e54c425806958ebb62e007e4d539169cdefa0f92f5
5
5
  SHA512:
6
- metadata.gz: 62c56c6a9bf49fd761bf16c74fc985fcb1717659d08b17b99db47264c90bcfd105d18a1376f09ce15379b216fbc64af7edc3233352907023daa9cb61b396cb5b
7
- data.tar.gz: c340d3fc7171eac32cfb9c7fd6dfb0854401896f57fde87032e53dbc5f0b05bd51c638da478eb4a02fbae20a6b6f2ea22ba6b80a1f9cd1e2027b016e13624044
6
+ metadata.gz: 3e4f1bb548052aaf0598c91c063c1443692ad2066edc74bd354afee1b31c9fe0b361cecdbf36d4213752ea9e9cbe11cf81ed7c425c7ed7f8798dc62300f01072
7
+ data.tar.gz: 290418ca0ede520b0fde69112698e3f5072e8c2bf697c9b64582bc8f46b306c70e5bac37ca1e9606091a4b7219b6c787adeb108b0ef41ecdfc8723d6d7780d89
data/.rubocop.yml ADDED
@@ -0,0 +1,3 @@
1
+ Metrics/LineLength:
2
+ Max: 120
3
+
data/.travis.yml ADDED
@@ -0,0 +1,36 @@
1
+ before_install:
2
+ - gem install bundler
3
+ bundler_args: "--verbose"
4
+ script:
5
+ - bundle exec rake build
6
+ rvm:
7
+ - 2.0.0
8
+ - 2.1
9
+ - 2.2
10
+ - 2.3.1
11
+ - 2.4
12
+ - 2.5
13
+ - ruby-head
14
+ gemfile:
15
+ - Gemfile
16
+ matrix:
17
+ allow_failures:
18
+ - rvm: ruby-head
19
+ env:
20
+ matrix:
21
+ - CODECLIMATE_REPO_TOKEN=2b46019558c79326fc3cc87f2e4261610256aee236063c4b62b8ed8d2c2ce21d
22
+ global:
23
+ secure: pIBdjy8REKRp9GPVeR22JYu0GrCmS2d1rz7Yyxo9lV7yMKUQK2lQw5PQ1fQizxK1NryiNx5nrYJol/EC9a/MTp8rGAOVwEYv5C7gO/Ede/ADuOo7OUjCvI+a88hWNQqp04cZAeYLaX0Avdz/odbkXKHAH8HTt028f1REMKXH3CUm7CmqTEPlB96xXk8nSH8IAQZZlSw1Yu2bIP18h4m73USh9JM/nZbfY7lz2jCxLeinFFJl3ELkfAtvuuo6ptyuu7uZTpZd/9H6N0ddEFUFUcimZbXCcF21S3BdTX6eSyB1h66q17Tx6fi7/rQh+Jah8yhOrgjr+LLZoIAXosgBt/LnfN2V1MqJVqd/ajN9TBVp+mB/NV7z+nqcUNSEbleOpE9tTb4DHa3izA2cL17wuA0sxxNuvaUVbu1u4iFQNfEtiVmCdqZwAp9cXeD0x1RSLWUofn413xAzQBNiH/UxXwVFvZzUwtrlkzEUyYWtprm9RWyJEaEr1a4Tv5LhjmeaB2e9gwDzIT/RZaTfTswZzpbBsN3/dOeLhZkH4hCbN7Um2OBymQlVTNpZp/jRM/pEepMUdJjQ2SUU26/9B5Xqp3M01zUr2Z65djmyAkK3DkdLAzGo9FdWZW7VdDKLaO17TeDWizkQLD9pZUr1QfniYJzUxqYb7oqfekhtcDCMOag=
24
+ addons:
25
+ code_climate:
26
+ repo_token: 2b46019558c79326fc3cc87f2e4261610256aee236063c4b62b8ed8d2c2ce21d
27
+ after_success:
28
+ - bundle exec codeclimate-test-reporter
29
+ deploy:
30
+ provider: rubygems
31
+ api_key:
32
+ secure: YnibTFYFBn8XvyocId6wfKm3qCrVOprorIkKHEok4g8AOo3VHea9YxChmp2E/yvVqDdT9G7yKg3hn+JwuolYOIyGVSlS7AXOHguzHLcOI7iYwAd+RWFXDmn1MMFIX/tVV0oeRu8mNGbxNIbofI6DtExH0RHRHN0FTIqxPzH8Se0TbkHzznKkouwu55CU8ss7kh/CYPeFJOEyfCxZ+NNm1cdWocNkMbhPxT2FgsXGRlIMsABc/UpTMUR2mtmGqFUiwnIKvxkhI9qUEePfqHYU/IVGubwUjSE5LJRvOtAOdglj4QH4UZKlI2TJI6kq4a/1q7lZuAnONyqdlROrmBIjm9K9g9l0XvCBeReNpZoXRxIS+78F0H1GSCvxajaRfJYk0Po4RZ6JE2N8hhxSpqyMRHy2mVQiu5fBMXaZXcH7buIgiPY7KH+JFBgyGUqFR8a+8d0kKuX0Fz/sM1YmO2iATtP+CXqSotDWmU4nn8dMoEyvzvHlG5O49ZIlhG+ze6SlryWOlgiewEk8Gf+Nn3q5En1jgxAZTSPy5eyzQdT4RR4dysMy8p1BGCxIXyaKDDZVtk3n+00kG4VMLmrLehfrjalNY6NDAkOEO5Fc1OrQEYXKT/CHlA3R7iaZDqsblRgfpEDYTsXAffMobyggnrrWZRxrJppvITGCFOb6FFvYjKI=
33
+ gemspec: saj_collector.gemspec
34
+ on:
35
+ tags: true
36
+ repo: jwillemsen/saj_collector
data/README.md CHANGED
@@ -1,6 +1,9 @@
1
1
  # SAJ Collector
2
2
 
3
+ [![Build Status](https://travis-ci.org/jwillemsen/saj_collector.png)](https://travis-ci.org/jwillemsen/saj_collector)
4
+ [![Code Climate](https://codeclimate.com/github/jwillemsen/saj_collector/badges/gpa.png)](https://codeclimate.com/github/jwillemsen/saj_collector)
3
5
  [![Codacy Badge](https://api.codacy.com/project/badge/Grade/fdb313b9a4b24614867b91e45a5505f9)](https://www.codacy.com/app/jwillemsen/saj_collector?utm_source=github.com&utm_medium=referral&utm_content=jwillemsen/saj_collector&utm_campaign=badger)
6
+ [![Gem Version](https://badge.fury.io/rb/saj_collector.svg)](http://badge.fury.io/rb/saj_collector)
4
7
 
5
8
  Pull stats from SAJ Solar Inverter and push them to PVOutput. This
6
9
  ruby gem is based on https://github.com/johnf/jfy_collector
data/Rakefile CHANGED
@@ -5,4 +5,4 @@ require 'rubocop/rake_task'
5
5
  RSpec::Core::RakeTask.new(:spec)
6
6
  RuboCop::RakeTask.new
7
7
 
8
- task :default => :spec
8
+ task default: :spec
data/exe/saj_collector CHANGED
@@ -6,7 +6,7 @@ require 'pvoutput/client'
6
6
  require 'yaml'
7
7
 
8
8
  # Load the configuration from the yaml file
9
- sajcollector_config = YAML::load_file('saj_collector.yaml')
9
+ sajcollector_config = YAML.load_file('saj_collector.yaml')
10
10
 
11
11
  # Create a pvoutput with the configured system_id and api_key which both
12
12
  # can be obtained from the pvoutput website
@@ -31,41 +31,41 @@ 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') { |e|
34
+ doc.elements.each('real_time_data/temp') do |e|
35
35
  options[:temperature] = e.text
36
- }
36
+ end
37
37
 
38
38
  # e-today is in kWh where pvoutput is Wh
39
- doc.elements.each('real_time_data/e-today') { |e|
39
+ doc.elements.each('real_time_data/e-today') do |e|
40
40
  options[:energy_generated] = e.text.to_f * 1000
41
- }
41
+ end
42
42
 
43
43
  # Get the power generated
44
- doc.elements.each('real_time_data/p-ac') { |e|
44
+ doc.elements.each('real_time_data/p-ac') do |e|
45
45
  options[:power_generated] = e.text
46
- }
46
+ end
47
47
 
48
48
  # Get the current amperage
49
- doc.elements.each('real_time_data/i-grid') { |e|
49
+ doc.elements.each('real_time_data/i-grid') do |e|
50
50
  options[:amperage] = e.text
51
- }
51
+ end
52
52
 
53
53
  # Get the voltage
54
- doc.elements.each('real_time_data/v-grid') { |e|
54
+ doc.elements.each('real_time_data/v-grid') do |e|
55
55
  options[:voltage] = e.text
56
- }
57
- doc.elements.each('real_time_data/e-today') { |e|
56
+ end
57
+ doc.elements.each('real_time_data/e-today') do |e|
58
58
  options[:power_today] = e.text
59
- }
60
- doc.elements.each('real_time_data/e-total') { |e|
59
+ end
60
+ doc.elements.each('real_time_data/e-total') do |e|
61
61
  options[:power_all_time] = e.text
62
- }
63
- doc.elements.each('real_time_data/t-today') { |e|
62
+ end
63
+ doc.elements.each('real_time_data/t-today') do |e|
64
64
  options[:runtime_today] = e.text
65
- }
66
- doc.elements.each('real_time_data/t-total') { |e|
65
+ end
66
+ doc.elements.each('real_time_data/t-total') do |e|
67
67
  options[:runtime_all_time] = e.text
68
- }
68
+ end
69
69
 
70
70
  puts '-------------------------'
71
71
  puts
@@ -84,8 +84,8 @@ puts " Run Time: #{options[:runtime_today]} Hours"
84
84
  puts " Run Time: #{options[:runtime_all_time]} Hours"
85
85
 
86
86
  pvoutput.add_status(
87
- :energy_generated => options[:energy_generated],
88
- :power_generated => options[:power_generated],
89
- :temperature => options[:temperature],
90
- :voltage => options[:voltage]
87
+ energy_generated: options[:energy_generated],
88
+ power_generated: options[:power_generated],
89
+ temperature: options[:temperature],
90
+ voltage: options[:voltage]
91
91
  )
@@ -6,7 +6,7 @@ require 'pvoutput/client'
6
6
  require 'yaml'
7
7
 
8
8
  # Load the configuration from the yaml file
9
- sajcollector_config = YAML::load_file('saj_collector.yaml')
9
+ sajcollector_config = YAML.load_file('saj_collector.yaml')
10
10
 
11
11
  # Create a pvoutput with the configured system_id and api_key which both
12
12
  # can be obtained from the pvoutput website
@@ -40,12 +40,12 @@ end
40
40
 
41
41
  while counter < days
42
42
  value = {
43
- :energy_generated => 0
43
+ energy_generated: 0
44
44
  }
45
45
  # Get the power output of the day,
46
- doc.elements.each("day_trend/d#{counter}") { |e|
46
+ doc.elements.each("day_trend/d#{counter}") do |e|
47
47
  value[:energy_generated] = (e.text.to_i * day_trend_multiplication).to_s
48
- }
48
+ end
49
49
  options[:"#{m}#{current_day.next!}"] = value
50
50
 
51
51
  counter += 1
@@ -1,3 +1,3 @@
1
1
  module SAJCollector
2
- VERSION = '0.5.1'.freeze
2
+ VERSION = '0.5.2'.freeze
3
3
  end
data/lib/say_collector.rb CHANGED
@@ -1,4 +1 @@
1
1
  require 'saj_collector/version'
2
-
3
- module SAJCollector
4
- end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saj_collector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johnny Willemsen
@@ -103,6 +103,8 @@ executables:
103
103
  extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
+ - ".rubocop.yml"
107
+ - ".travis.yml"
106
108
  - CODE_OF_CONDUCT.md
107
109
  - Gemfile
108
110
  - LICENSE.txt
@@ -135,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
137
  version: '0'
136
138
  requirements: []
137
139
  rubyforge_project:
138
- rubygems_version: 2.7.3
140
+ rubygems_version: 2.7.7
139
141
  signing_key:
140
142
  specification_version: 4
141
143
  summary: Pull stats from SAJ Solar Inverter and push them to PVOutput