tibber 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad415b5607dc399b32cbeca2414445c8aa5c13945d7e831168b61be8ba4c5680
4
- data.tar.gz: c07a1c65eecbb6afb61d1c08bfa8c0b3980b1690a30a246a6033422327b3ad30
3
+ metadata.gz: 9988f6aad8ec756b4be98dd516806a85dbbe03594a7a5062365796ecb6ae1e79
4
+ data.tar.gz: 72354be54db643b5a93c843672272a4d427d6ade18ff29dd01ec83b8d2a06c20
5
5
  SHA512:
6
- metadata.gz: afa6b65748b4cf01c1d524cbce1c1dea093460f9b9de63dde564a723ec754ce4d66071661317fa1d96d5d889b61b967dd600be252e77f9a57ac0b958e05ec2bb
7
- data.tar.gz: 682d3a9280953ec497e506a769447864a5053c8188843020f335f37166754736e5a3891b16a092e790fff61ee62e32cbd920576df38cb9f84a680c8030fb4d99
6
+ metadata.gz: 8a519bf958e5ed6d00522ec2cc98bdeb9d21e212df9e63752db48bf9758d0b32098d2cb0d736fbfbdde465912f5d13b4de1ae821526633b7087f1cbb4be162c9
7
+ data.tar.gz: a756bb3d459b41a97f2fb1279f5e66059cc2085acc4081ae1b5937230f0aeda927b12f60d7434965926138698accd6a328916523ad2c112a6cc25605270d3f0c
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
- ## Changelog
1
+ # Changelog
2
2
 
3
3
  ## [0.1.0] - 2024-02-25
4
+
4
5
  - Initial release
5
6
 
6
7
  ## [0.1.1] - 2025-03-20
8
+
7
9
  - update tests, simplify some code, add docs
10
+
11
+ ## [0.2.0] - 2025-09-26
12
+
13
+ - support quarterly resolution for price info
data/README.md CHANGED
@@ -26,7 +26,8 @@ Or install it yourself as:
26
26
 
27
27
  ## Usage
28
28
 
29
- Before you start making the requests to API provide the endpoint and api key using the configuration wrapping.
29
+ Before you start making the requests to API provide the endpoint and api key
30
+ using the configuration wrapping.
30
31
 
31
32
  ```ruby
32
33
  require 'tibber'
@@ -39,7 +40,7 @@ Tibber.configure do |config|
39
40
  end
40
41
 
41
42
  # or configure with options hash
42
- client = Tibber.client
43
+ client = Tibber.client(access_token: ENV['TIBBER_ACCESS_TOKEN'], logger: Logger.new(TEST_LOGGER))
43
44
  client.login
44
45
 
45
46
  ```
@@ -65,7 +66,7 @@ end
65
66
  Endpoint for data related requests
66
67
 
67
68
  ```ruby
68
- # show todays prices
69
+ # show todays prices; by default prices are per hour
69
70
  prices = client.price_info
70
71
 
71
72
  prices.homes.each do |home|
@@ -75,6 +76,8 @@ prices.homes.each do |home|
75
76
  end
76
77
  end
77
78
 
79
+ # but also possible per quarter
80
+ prices = client.price_info(Tibber::Resolution::QUARTER_HOURLY)
78
81
  ```
79
82
 
80
83
  |Resource|API endpoint|
@@ -95,6 +98,7 @@ end
95
98
  > rake test
96
99
  > rake build
97
100
  ```
101
+
98
102
  5. Release
99
103
 
100
104
  ```console
@@ -103,7 +107,7 @@ end
103
107
 
104
108
  ## Contributing
105
109
 
106
- Bug reports and pull requests are welcome on GitHub at https://github.com/jancotanis/tibber.
110
+ Bug reports and pull requests are welcome on [GitHub](https://github.com/jancotanis/tibber).
107
111
 
108
112
  ## License
109
113
 
data/lib/tibber/client.rb CHANGED
@@ -104,13 +104,13 @@ module Tibber
104
104
  }
105
105
  }
106
106
  }'
107
- api_endpoint :price_info, '
107
+ api_endpoint :_price_info, '
108
108
  {
109
109
  viewer {
110
110
  homes {
111
111
  id
112
112
  currentSubscription{
113
- priceInfo{
113
+ priceInfo(resolution: %{resolution}){
114
114
  current{
115
115
  startsAt
116
116
  total
@@ -137,7 +137,12 @@ module Tibber
137
137
  }
138
138
  }
139
139
  }'
140
- api_endpoint:_send_push_notification, '
140
+
141
+ def price_info(resolution = Resolution::HOURLY)
142
+ _price_info({ resolution: resolution })
143
+ end
144
+
145
+ api_endpoint :_send_push_notification, '
141
146
  mutation {
142
147
  sendPushNotification(input: {
143
148
  title: "%{title}",
data/lib/tibber/const.rb CHANGED
@@ -44,7 +44,7 @@ module Tibber
44
44
  # - NOTIFICATIONS
45
45
  # - INVOICES
46
46
  enum %w[
47
- HOME REPORTS CONSUMPTION COMPARISON DISAGGREGATION
47
+ HOME REPORTS CONSUMPTION COMPARISON DISAGGREGATION
48
48
  HOME_PROFILE CUSTOMER_PROFILE METER_READING NOTIFICATIONS INVOICES
49
49
  ]
50
50
  end
@@ -57,12 +57,13 @@ module Tibber
57
57
  # Resolution::DAILY # => "DAILY"
58
58
  class Resolution < Enum
59
59
  # Defines time resolution constants:
60
+ # - QUARTER_HOURLY
60
61
  # - HOURLY
61
62
  # - DAILY
62
63
  # - WEEKLY
63
64
  # - MONTHLY
64
65
  # - ANNUAL
65
- enum %w[HOURLY DAILY WEEKLY MONTHLY ANNUAL]
66
+ enum %w[QUARTER_HOURLY HOURLY DAILY WEEKLY MONTHLY ANNUAL]
66
67
  end
67
68
 
68
69
  # The `HomeType` class defines different types of homes as constants.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tibber
4
- VERSION = '0.1.1'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tibber
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janco Tanis
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-20 00:00:00.000000000 Z
10
+ date: 2025-09-26 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: faraday