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 +4 -4
- data/CHANGELOG.md +7 -1
- data/README.md +8 -4
- data/lib/tibber/client.rb +8 -3
- data/lib/tibber/const.rb +3 -2
- data/lib/tibber/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9988f6aad8ec756b4be98dd516806a85dbbe03594a7a5062365796ecb6ae1e79
|
4
|
+
data.tar.gz: 72354be54db643b5a93c843672272a4d427d6ade18ff29dd01ec83b8d2a06c20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a519bf958e5ed6d00522ec2cc98bdeb9d21e212df9e63752db48bf9758d0b32098d2cb0d736fbfbdde465912f5d13b4de1ae821526633b7087f1cbb4be162c9
|
7
|
+
data.tar.gz: a756bb3d459b41a97f2fb1279f5e66059cc2085acc4081ae1b5937230f0aeda927b12f60d7434965926138698accd6a328916523ad2c112a6cc25605270d3f0c
|
data/CHANGELOG.md
CHANGED
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
|
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
|
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 :
|
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
|
-
|
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.
|
data/lib/tibber/version.rb
CHANGED
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.
|
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-
|
10
|
+
date: 2025-09-26 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: faraday
|