saj_collector 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/.travis.yml +36 -0
- data/README.md +3 -0
- data/Rakefile +1 -1
- data/exe/saj_collector +23 -23
- data/exe/saj_output_collector +4 -4
- data/lib/saj_collector/version.rb +1 -1
- data/lib/say_collector.rb +0 -3
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7c1f47dd27e1e93a45287ea5d5f0ed689cc4f3d3450bf0c53af032bc4836c2b0
|
|
4
|
+
data.tar.gz: afaeb38f25bea2870db7e3e54c425806958ebb62e007e4d539169cdefa0f92f5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e4f1bb548052aaf0598c91c063c1443692ad2066edc74bd354afee1b31c9fe0b361cecdbf36d4213752ea9e9cbe11cf81ed7c425c7ed7f8798dc62300f01072
|
|
7
|
+
data.tar.gz: 290418ca0ede520b0fde69112698e3f5072e8c2bf697c9b64582bc8f46b306c70e5bac37ca1e9606091a4b7219b6c787adeb108b0ef41ecdfc8723d6d7780d89
|
data/.rubocop.yml
ADDED
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
|
+
[](https://travis-ci.org/jwillemsen/saj_collector)
|
|
4
|
+
[](https://codeclimate.com/github/jwillemsen/saj_collector)
|
|
3
5
|
[](https://www.codacy.com/app/jwillemsen/saj_collector?utm_source=github.com&utm_medium=referral&utm_content=jwillemsen/saj_collector&utm_campaign=badger)
|
|
6
|
+
[](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
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
|
|
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')
|
|
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')
|
|
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')
|
|
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')
|
|
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')
|
|
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')
|
|
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')
|
|
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')
|
|
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')
|
|
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
|
-
:
|
|
88
|
-
:
|
|
89
|
-
:
|
|
90
|
-
:
|
|
87
|
+
energy_generated: options[:energy_generated],
|
|
88
|
+
power_generated: options[:power_generated],
|
|
89
|
+
temperature: options[:temperature],
|
|
90
|
+
voltage: options[:voltage]
|
|
91
91
|
)
|
data/exe/saj_output_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
|
|
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
|
-
:
|
|
43
|
+
energy_generated: 0
|
|
44
44
|
}
|
|
45
45
|
# Get the power output of the day,
|
|
46
|
-
doc.elements.each("day_trend/d#{counter}")
|
|
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
|
data/lib/say_collector.rb
CHANGED
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.
|
|
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.
|
|
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
|