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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a0e32b86391108e73fe14c279167f59b95a62b212ebd26ba385009b6f6910c6a
4
- data.tar.gz: fdb0b4bcfa18d5f3643811db8c5638f65f08718b7a6a69ba6447239a74878eb2
3
+ metadata.gz: '02099a9a784416f8781be175eb5f16eaa1870b68f50fc7af7eecb670a085d281'
4
+ data.tar.gz: 195b72840d17e3a25d4ce389c98b3307889f19432b72e293382bab831aba884d
5
5
  SHA512:
6
- metadata.gz: f575fb51be5d5d9c8f24630d90799fc6062e8be9313c0a31a2c35906bfc30c1004d0c5c8a4b03cebc5fb392e5b2a270f597aeaae36d14e4050cb843f2504dcc3
7
- data.tar.gz: '06391f6189aeea508e877614541fc82f44308f0ef35be781a7c2edfb600ba909b7c8413a9ec2ee0a2f41faca01c5e36e65f86101e9ce52bdcdefca1b845ac897'
6
+ metadata.gz: 17feb85780f015d22a5aac70fe6ff9b6923448a3e459a795b2ff52c624fab3d0fd6c4c0accd1fd2796475dcc2f60713fcdd0846f435263682595e3bc6b6cb6f2
7
+ data.tar.gz: bfd3123ef03d7ff5915f27ad7642f976b34a058ca2fce0769170a82df94521f08343eef6ee72078225fd3f380365e79b360b9b46b3101b4677a6f0c8e4e76a4e
@@ -1,4 +1,4 @@
1
- name: Ruby
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 7 * * SUN'
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
- name: [
17
- Ruby24,
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
- - name: Set up Ruby 2.6
34
- uses: actions/setup-ruby@v1
20
+ - uses: ruby/setup-ruby@v1
35
21
  with:
36
- ruby-version: ${{ matrix.RubyVersion }}
37
- - name: Build and test with Rake
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
- [![Build Status](https://travis-ci.org/jwillemsen/saj_collector.png)](https://travis-ci.org/jwillemsen/saj_collector)
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)](http://badge.fury.io/rb/saj_collector)
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 once to PVOutput.
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 once to PVOutput.
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 collecor
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.
@@ -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 ("[#{sajcollector_config[:saj]}] is not a valid IP address, please correct your #{yaml_file} file")
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
@@ -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 ("[#{sajcollector_config[:saj]}] is not a valid IP address, please correct your #{yaml_file} file")
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
 
@@ -1,3 +1,3 @@
1
1
  module SAJCollector
2
- VERSION = '0.5.8'.freeze
2
+ VERSION = '1.0.0'.freeze
3
3
  end
@@ -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.4.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.5.8
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-08-19 00:00:00.000000000 Z
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.4.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.4.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: []
@@ -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
data/circle.yml DELETED
@@ -1,9 +0,0 @@
1
- test:
2
- post:
3
- - bundle exec rubocop
4
- machine:
5
- ruby:
6
- version: 2.6.0
7
- dependencies:
8
- pre:
9
- - gem install bundler --pre