Skip to content

Commit 886963a

Browse files
committed
chore: add price_info_query to to QueryBuilder
1 parent 6fccac3 commit 886963a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tibber/networking/query_builder.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""A class for generating GraphQL queries to send to the Tibber API"""
2+
from typing import Literal
23

34

45
class QueryBuilder:
@@ -307,6 +308,17 @@ def price_info_range_query(
307308
}
308309
}
309310

311+
@classmethod
312+
def price_info_query(cls, resolution: Literal["HOURLY", "QUARTER_HOURLY"]):
313+
return {
314+
f"priceInfo(resolution: {resolution})": {
315+
"current": QueryBuilder.price(),
316+
"today": QueryBuilder.price(),
317+
"tomorrow": QueryBuilder.price(),
318+
}
319+
}
320+
321+
310322
@classmethod
311323
def range_query(
312324
cls, resolution: str, first: int, last: int, before: str, after: str

0 commit comments

Comments
 (0)