Skip to content

Commit 6e857ac

Browse files
authored
adding price rating
1 parent 482412d commit 6e857ac

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/Tibber.php

+30
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,36 @@ public function homes($homeId = null, $subquery = '')
151151
return $this->viewer($subquery);
152152
}
153153

154+
public function priceRating($homeId = null, $subquery = '')
155+
{
156+
$action = ($homeId === null) ? 'homes' : 'home(id:'.$homeId.')';
157+
$subquery = <<<GQL
158+
$action {
159+
$subquery
160+
id
161+
currentSubscription {
162+
status
163+
priceRating {
164+
hourly {
165+
entries{
166+
time
167+
total
168+
tax
169+
energy
170+
level
171+
}
172+
173+
174+
}
175+
}
176+
}
177+
178+
}
179+
GQL;
180+
181+
return $this->viewer($subquery);
182+
}
183+
154184
public function consumption($homeId = null, $resolution = Tibber::HOURLY, $last = 100)
155185
{
156186
$subquery = <<<GQL

0 commit comments

Comments
 (0)