Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update query #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions octopus.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ def get_account_number(token: str) -> str:


GET_HH_BODY = """
query halfHourlyReadings($accountNumber: String!, $fromDatetime: DateTime, $toDatetime: DateTime) {
query halfHourlyReadings($accountNumber: String!, $fromDatetime: DateTime, $toDatetime: DateTime, $productCode: String!) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'd also need to update the place where this is used I think - down on line 117

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FraserTooth did you mean around here?
Screenshot 2023-01-26 at 9 49 13

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

account(accountNumber: $accountNumber) {
properties {
electricitySupplyPoints {
halfHourlyReadings(fromDatetime: $fromDatetime, toDatetime: $toDatetime) {
halfHourlyReadings(fromDatetime: $fromDatetime, toDatetime: $toDatetime, productCode: $productCode) {
startAt
endAt
version
value
costEstimate
}
}
}
Expand All @@ -101,11 +102,13 @@ def get_hh_readings(
token: str,
start_at: datetime.datetime,
end_at: Optional[datetime.datetime] = None,
product_code: str
) -> List[HHReading]:

variables = {
"accountNumber": account_number,
"fromDatetime": start_at.isoformat(),
"productCode": product_code,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit - you found it tho 👍

}
if end_at:
variables["toDatetime"] = end_at.isoformat()
Expand Down