Skip to content

Commit

Permalink
Merge pull request #35 from jwillemsen/jwi-donationmode
Browse files Browse the repository at this point in the history
Fixed saj_output_collector to fix addbatchoutput changes
  • Loading branch information
jwillemsen authored Jul 11, 2021
2 parents 8ae9517 + f5e0dca commit c44a59b
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@ a granularity of 0.01kWh. In case of the last you have to change the ```day_tren
within your ```saj_collector.yaml``` to 10. An incorrect ```day_trend_multiplication_factor``` triggers
a `Bad Post` exception when running the `saj_output_collector` script.

At the moment you are a [PVOutput donator](https://pvoutput.org/donate.jsp) change ```donation_mode``` to
true to enable the donation features of PVOutput.

``` yaml
:saj: a.b.c.d
:system_id: 123456
:api_key: fb6a2e3
:day_trend_multiplication_factor: 100
:donation_mode: false
```
Run the SAJ Collector from the command prompt or shell
Expand Down
7 changes: 5 additions & 2 deletions exe/saj_collector
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ yaml_file = 'saj_collector.yaml'
sajcollector_config = YAML.load_file(yaml_file)

# Create a pvoutput with the configured system_id and api_key which both
# can be obtained from the pvoutput website
pvoutput = PVOutput::Client.new(sajcollector_config[:system_id], sajcollector_config[:api_key])
# can be obtained from the pvoutput website. At the moment donation_mode
# has been specified batching can be used
pvoutput = PVOutput::Client.new(
sajcollector_config[:system_id], sajcollector_config[:api_key], sajcollector_config[:donation_mode]
)

unless IPAddress.valid?(sajcollector_config[:saj])
raise("[#{sajcollector_config[:saj]}] is not a valid IP address, please correct your #{yaml_file} file")
Expand Down
7 changes: 5 additions & 2 deletions exe/saj_output_collector
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ yaml_file = 'saj_collector.yaml'
sajcollector_config = YAML.load_file(yaml_file)

# Create a pvoutput with the configured system_id and api_key which both
# can be obtained from the pvoutput website
pvoutput = PVOutput::Client.new(sajcollector_config[:system_id], sajcollector_config[:api_key])
# can be obtained from the pvoutput website. At the moment donation_mode
# has been specified batching can be used
pvoutput = PVOutput::Client.new(
sajcollector_config[:system_id], sajcollector_config[:api_key], sajcollector_config[:donation_mode]
)

unless IPAddress.valid?(sajcollector_config[:saj])
raise("[#{sajcollector_config[:saj]}] is not a valid IP address, please correct your #{yaml_file} file")
Expand Down
2 changes: 1 addition & 1 deletion lib/saj_collector/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module SAJCollector
VERSION = '1.0.3'
VERSION = '1.1.0'
end
2 changes: 1 addition & 1 deletion saj_collector.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
spec.required_ruby_version = '>= 2.5'

spec.add_dependency 'ipaddress'
spec.add_dependency 'pvoutput', '>= 1.0'
spec.add_dependency 'pvoutput', '> 1.0'

spec.add_development_dependency 'bundler'
spec.add_development_dependency 'rake', '>= 12.3.3'
Expand Down

0 comments on commit c44a59b

Please sign in to comment.