Skip to content

Commit

Permalink
Merge pull request #4 from arnebr/feat-notification-channel
Browse files Browse the repository at this point in the history
adding price rating
  • Loading branch information
arnebr authored Feb 11, 2023
2 parents 2abe5e6 + 6e857ac commit 8fca594
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Tibber.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,36 @@ public function homes($homeId = null, $subquery = '')
return $this->viewer($subquery);
}

public function priceRating($homeId = null, $subquery = '')
{
$action = ($homeId === null) ? 'homes' : 'home(id:'.$homeId.')';
$subquery = <<<GQL
$action {
$subquery
id
currentSubscription {
status
priceRating {
hourly {
entries{
time
total
tax
energy
level
}
}
}
}
}
GQL;

return $this->viewer($subquery);
}

public function consumption($homeId = null, $resolution = Tibber::HOURLY, $last = 100)
{
$subquery = <<<GQL
Expand Down

0 comments on commit 8fca594

Please sign in to comment.