saj_collector 0.5.8 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +14 -21
- data/README.md +5 -7
- data/exe/saj_collector +1 -1
- data/exe/saj_output_collector +2 -2
- data/lib/saj_collector/version.rb +1 -1
- data/saj_collector.gemspec +1 -1
- metadata +8 -10
- data/.travis.yml +0 -27
- data/circle.yml +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '02099a9a784416f8781be175eb5f16eaa1870b68f50fc7af7eecb670a085d281'
|
4
|
+
data.tar.gz: 195b72840d17e3a25d4ce389c98b3307889f19432b72e293382bab831aba884d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17feb85780f015d22a5aac70fe6ff9b6923448a3e459a795b2ff52c624fab3d0fd6c4c0accd1fd2796475dcc2f60713fcdd0846f435263682595e3bc6b6cb6f2
|
7
|
+
data.tar.gz: bfd3123ef03d7ff5915f27ad7642f976b34a058ca2fce0769170a82df94521f08343eef6ee72078225fd3f380365e79b360b9b46b3101b4677a6f0c8e4e76a4e
|
data/.github/workflows/ruby.yml
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
name:
|
1
|
+
name: ruby
|
2
2
|
|
3
3
|
on:
|
4
4
|
push:
|
@@ -6,36 +6,29 @@ on:
|
|
6
6
|
branches:
|
7
7
|
- master
|
8
8
|
schedule:
|
9
|
-
- cron: '0
|
9
|
+
- cron: '0 1 * * SUN'
|
10
10
|
|
11
11
|
jobs:
|
12
12
|
build:
|
13
13
|
runs-on: ubuntu-latest
|
14
14
|
strategy:
|
15
15
|
matrix:
|
16
|
-
|
17
|
-
|
18
|
-
Ruby25,
|
19
|
-
Ruby26,
|
20
|
-
Ruby27
|
21
|
-
]
|
22
|
-
include:
|
23
|
-
- name: Ruby24
|
24
|
-
RubyVersion: 2.4
|
25
|
-
- name: Ruby25
|
26
|
-
RubyVersion: 2.5
|
27
|
-
- name: Ruby26
|
28
|
-
RubyVersion: 2.6
|
29
|
-
- name: Ruby27
|
30
|
-
RubyVersion: 2.7
|
16
|
+
ruby-version: [ 2.4, 2.5, 2.6, 2.7, ruby-head ]
|
17
|
+
name: ruby ${{ matrix.ruby-version }}
|
31
18
|
steps:
|
32
19
|
- uses: actions/checkout@v1
|
33
|
-
-
|
34
|
-
uses: actions/setup-ruby@v1
|
20
|
+
- uses: ruby/setup-ruby@v1
|
35
21
|
with:
|
36
|
-
ruby-version: ${{ matrix.
|
37
|
-
- name:
|
22
|
+
ruby-version: ${{ matrix.ruby-version }}
|
23
|
+
- name: Install dependencies
|
38
24
|
run: |
|
39
25
|
gem install bundler
|
40
26
|
bundle install --jobs 4 --retry 3
|
27
|
+
- name: Lint files
|
28
|
+
run: |
|
29
|
+
bundle exec rubocop
|
30
|
+
- name: Test with Rake
|
31
|
+
run: |
|
41
32
|
bundle exec rake
|
33
|
+
|
34
|
+
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# SAJ Collector
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Actions Status](https://github.com/jwillemsen/saj_collector/workflows/ruby/badge.svg)](https://github.com/jwillemsen/saj_collector/actions)
|
4
4
|
[![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)
|
5
|
-
[![Gem Version](https://badge.fury.io/rb/saj_collector.svg)](
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/saj_collector.svg)](https://badge.fury.io/rb/saj_collector)
|
6
6
|
|
7
7
|
Pull stats from SAJ Solar Inverter and push them to PVOutput. This
|
8
8
|
ruby gem is based on https://github.com/johnf/jfy_collector
|
@@ -40,16 +40,14 @@ Run the SAJ Collector from the command prompt or shell
|
|
40
40
|
saj_collector
|
41
41
|
|
42
42
|
This will run the current power generation frm the SAJ Collector and push the
|
43
|
-
data
|
43
|
+
data to PVOutput.
|
44
44
|
|
45
45
|
The SAJ Output Collector will retrieve the generation of each day of the current month and
|
46
|
-
push the data
|
47
|
-
|
48
|
-
Run the SAJ Output Collector from the command prompt or shell
|
46
|
+
push the data to PVOutput. Run the SAJ Output Collector from the command prompt or shell
|
49
47
|
|
50
48
|
saj_output_collector
|
51
49
|
|
52
|
-
## Scheduling the
|
50
|
+
## Scheduling the collector
|
53
51
|
|
54
52
|
On Linux you can add ``saj_collector`` and ``saj_output_collector`` to your crontab to let it automatically push with
|
55
53
|
a certain frequency.
|
data/exe/saj_collector
CHANGED
@@ -16,7 +16,7 @@ sajcollector_config = YAML.load_file(yaml_file)
|
|
16
16
|
pvoutput = PVOutput::Client.new(sajcollector_config[:system_id], sajcollector_config[:api_key])
|
17
17
|
|
18
18
|
unless IPAddress.valid?(sajcollector_config[:saj])
|
19
|
-
raise
|
19
|
+
raise("[#{sajcollector_config[:saj]}] is not a valid IP address, please correct your #{yaml_file} file")
|
20
20
|
end
|
21
21
|
|
22
22
|
# Get the current realtime data from the SAJ device
|
data/exe/saj_output_collector
CHANGED
@@ -16,7 +16,7 @@ sajcollector_config = YAML.load_file(yaml_file)
|
|
16
16
|
pvoutput = PVOutput::Client.new(sajcollector_config[:system_id], sajcollector_config[:api_key])
|
17
17
|
|
18
18
|
unless IPAddress.valid?(sajcollector_config[:saj])
|
19
|
-
raise
|
19
|
+
raise("[#{sajcollector_config[:saj]}] is not a valid IP address, please correct your #{yaml_file} file")
|
20
20
|
end
|
21
21
|
|
22
22
|
# Get the current day trend data from the SAJ device
|
@@ -59,7 +59,7 @@ while counter < days
|
|
59
59
|
end
|
60
60
|
|
61
61
|
options.each do |date, values|
|
62
|
-
energy_generated = values[:energy_generated].to_i/1000.0
|
62
|
+
energy_generated = values[:energy_generated].to_i / 1000.0
|
63
63
|
puts "Energy generated #{date}: #{energy_generated} kWh"
|
64
64
|
end
|
65
65
|
|
data/saj_collector.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
19
|
|
20
20
|
spec.add_dependency 'ipaddress'
|
21
|
-
spec.add_dependency 'pvoutput', '~> 0.
|
21
|
+
spec.add_dependency 'pvoutput', '~> 0.5.0'
|
22
22
|
|
23
23
|
spec.add_development_dependency 'bundler'
|
24
24
|
spec.add_development_dependency 'rake', '>= 12.3.3'
|
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.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johnny Willemsen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ipaddress
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.5.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.5.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
|
-
description:
|
111
|
+
description:
|
112
112
|
email:
|
113
113
|
- jwillemsen@remedy.nl
|
114
114
|
executables:
|
@@ -120,14 +120,12 @@ files:
|
|
120
120
|
- ".github/FUNDING.yml"
|
121
121
|
- ".github/workflows/ruby.yml"
|
122
122
|
- ".rubocop.yml"
|
123
|
-
- ".travis.yml"
|
124
123
|
- CODE_OF_CONDUCT.md
|
125
124
|
- Gemfile
|
126
125
|
- LICENSE.txt
|
127
126
|
- README.md
|
128
127
|
- Rakefile
|
129
128
|
- bin/setup
|
130
|
-
- circle.yml
|
131
129
|
- exe/saj_collector
|
132
130
|
- exe/saj_output_collector
|
133
131
|
- lib/saj_collector/version.rb
|
@@ -137,7 +135,7 @@ homepage: https://github.com/jwillemsen/saj_collector
|
|
137
135
|
licenses:
|
138
136
|
- MIT
|
139
137
|
metadata: {}
|
140
|
-
post_install_message:
|
138
|
+
post_install_message:
|
141
139
|
rdoc_options: []
|
142
140
|
require_paths:
|
143
141
|
- lib
|
@@ -153,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
151
|
version: '0'
|
154
152
|
requirements: []
|
155
153
|
rubygems_version: 3.0.8
|
156
|
-
signing_key:
|
154
|
+
signing_key:
|
157
155
|
specification_version: 4
|
158
156
|
summary: Pull stats from SAJ Solar Inverter and push them to PVOutput
|
159
157
|
test_files: []
|
data/.travis.yml
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
before_install:
|
2
|
-
- gem install bundler
|
3
|
-
bundler_args: "--verbose"
|
4
|
-
script:
|
5
|
-
- bundle exec rake build
|
6
|
-
rvm:
|
7
|
-
- 2.3.1
|
8
|
-
- 2.4
|
9
|
-
- 2.5
|
10
|
-
- 2.6
|
11
|
-
- 2.7
|
12
|
-
- ruby-head
|
13
|
-
gemfile:
|
14
|
-
- Gemfile
|
15
|
-
matrix:
|
16
|
-
allow_failures:
|
17
|
-
- rvm: ruby-head
|
18
|
-
env:
|
19
|
-
matrix:
|
20
|
-
- CODECLIMATE_REPO_TOKEN=2b46019558c79326fc3cc87f2e4261610256aee236063c4b62b8ed8d2c2ce21d
|
21
|
-
global:
|
22
|
-
secure: pIBdjy8REKRp9GPVeR22JYu0GrCmS2d1rz7Yyxo9lV7yMKUQK2lQw5PQ1fQizxK1NryiNx5nrYJol/EC9a/MTp8rGAOVwEYv5C7gO/Ede/ADuOo7OUjCvI+a88hWNQqp04cZAeYLaX0Avdz/odbkXKHAH8HTt028f1REMKXH3CUm7CmqTEPlB96xXk8nSH8IAQZZlSw1Yu2bIP18h4m73USh9JM/nZbfY7lz2jCxLeinFFJl3ELkfAtvuuo6ptyuu7uZTpZd/9H6N0ddEFUFUcimZbXCcF21S3BdTX6eSyB1h66q17Tx6fi7/rQh+Jah8yhOrgjr+LLZoIAXosgBt/LnfN2V1MqJVqd/ajN9TBVp+mB/NV7z+nqcUNSEbleOpE9tTb4DHa3izA2cL17wuA0sxxNuvaUVbu1u4iFQNfEtiVmCdqZwAp9cXeD0x1RSLWUofn413xAzQBNiH/UxXwVFvZzUwtrlkzEUyYWtprm9RWyJEaEr1a4Tv5LhjmeaB2e9gwDzIT/RZaTfTswZzpbBsN3/dOeLhZkH4hCbN7Um2OBymQlVTNpZp/jRM/pEepMUdJjQ2SUU26/9B5Xqp3M01zUr2Z65djmyAkK3DkdLAzGo9FdWZW7VdDKLaO17TeDWizkQLD9pZUr1QfniYJzUxqYb7oqfekhtcDCMOag=
|
23
|
-
addons:
|
24
|
-
code_climate:
|
25
|
-
repo_token: 2b46019558c79326fc3cc87f2e4261610256aee236063c4b62b8ed8d2c2ce21d
|
26
|
-
after_success:
|
27
|
-
- bundle exec codeclimate-test-reporter
|