
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
This is a wrapper for the Tibber rest API.
Add this line to your application's Gemfile:
gem 'tibber'
And then execute:
> bundle install
Or install it yourself as:
> gem install tibber
Before you start making the requests to API provide the endpoint and api key using the configuration wrapping.
require 'tibber'
require 'logger'
# use do block
Tibber.configure do |config|
config.access_token = ENV['TIBBER_ACCESS_TOKEN']
config.logger = Logger.new(TEST_LOGGER)
end
# or configure with options hash
client = Tibber.client
client.login
# setup
#
begin
client = Tibber.client
client.login
rescue Tibber::AuthenticationError => e
puts "Error logging in tibber api"
puts e
end
Endpoint for data related requests
# show todays prices
prices = client.price_info
prices.homes.each do |home|
puts "Today's prices:"
home.currentSubscription.priceInfo.today.each do |hour|
puts "#{hour.startsAt} #{hour.total} #{hour.currency} (#{hour.energy} + #{hour.tax})"
end
end
Resource | API endpoint |
---|---|
.information | returns name userId login accountType websocketSubscriptionUrl homes including homes meteringPointData, subscriptions and features |
.price_info | price information for all homes[id,currentSubscription{priceInfo{current,today[],tomorrow[]}}] |
.consumption(home_id, resolution, count) | Array of home.consumption.nodes[] : from to cost unitPrice unitPriceVAT consumption consumptionUnit |
.send_push_notification(title, message, screen_to_open) | send notificartion ot devices and returns successful & pushedToNumberOfDevices |
> rake test
> rake build
> rake release
Bug reports and pull requests are welcome on GitHub at https://github.com/jancotanis/tibber.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that tibber demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.