A Ruby wrapper around PVOutput API.
Update 30/06/2016 Since working on this over a year ago another similar project has sprung up (see https://github.com/johnf/pvoutput). There is currently no overlap in functionality so I decided to publish the Gem anyway. In the longterm these projects should probably merge.
See also related project pvoutput-qif.
Add this line to your application's Gemfile:
gem 'pvoutput-api'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install pvoutput-api
require 'pvoutput-api'
pvo_auth = PVOutput::Auth.new('8313', 'secret')
stat_data = PVOutput::Statistic.fetch("20150622", "20150622", pvo_auth)
puts stat_data.debit_amount
puts stat_data.energy_consumed
At the time of writing, the PVOutput API consists of the following services.
The following rate limits applies per API key for all request types -
- 60 requests per hour.
- 300 requests per hour in donation mode.
It is recommended to make requests at least 10 seconds apart.
Tests can be run using:
rake test
or with Guard
bundle exec guard
Raise an issue via Github. If the issue is related to the PVOutput API call, enable logging with the following environment variable:
RESTCLIENT_LOG=stdout
Copy and paste the exact output into the Issue.
- Fork it ( https://github.com/jonbartlett/pvoutput-api/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request