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

Add configurable index to historical requests #1

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

shtrom
Copy link

@shtrom shtrom commented Aug 13, 2023

Useful for LeighCurran/AuroraPlusHA#6 and LeighCurran/AuroraPlusHA#9, to retrieve more than the last day.

>>> time.asctime()  # today
'Sun Aug 13 23:07:59 2023'
>>> api.getday()  # same behaviour as before: data for yesterday
>>> api.day['StartDate']
'2023-08-11T14:00:00Z'
>>> api.day['NoDataFlag']
False
>>> api.getday(0)  # we can get the data for today, but it's a bit useless
>>> api.day['StartDate']
'2023-08-12T14:00:00Z'
>>> api.day['NoDataFlag']
True
>>> api.getday(-2)  # we can get data for the day before yesterday
>>> api.day['StartDate']
'2023-08-10T14:00:00Z'
>>> api.day['NoDataFlag']
False
>>> # 
>>> api.getday(2)  # we can request consumption for the day after tomorrow!
>>> api.day['StartDate']
'2023-08-14T14:00:00Z'
>>> api.day['NoDataFlag']
True
```

shtrom added a commit to shtrom/AuroraPlusHA that referenced this pull request Aug 13, 2023
Waiting for LeighCurran/AuroraPlus#1 to be merged.

Signed-off-by: Olivier Mehani <[email protected]>
shtrom added a commit to shtrom/AuroraPlusHA that referenced this pull request Aug 13, 2023
Waiting for LeighCurran/AuroraPlus#1 to be merged.

Signed-off-by: Olivier Mehani <[email protected]>
@shtrom shtrom force-pushed the more-than-1-day branch 2 times, most recently from f9fb956 to b35de50 Compare August 13, 2023 13:53
Signed-off-by: Olivier Mehani <[email protected]>
@shtrom
Copy link
Author

shtrom commented Aug 13, 2023

@LeighCurran It looks like v1.5.0 is not available in the repo. Would you be able to push it? I'll rebase my changes on that version.

Signed-off-by: Olivier Mehani <[email protected]>
shtrom added a commit to shtrom/AuroraPlusHA that referenced this pull request Aug 13, 2023
Waiting for LeighCurran/AuroraPlus#1 to be merged.

Signed-off-by: Olivier Mehani <[email protected]>
shtrom added a commit to shtrom/AuroraPlusHA that referenced this pull request Aug 14, 2023
Waiting for LeighCurran/AuroraPlus#1 to be merged.

Signed-off-by: Olivier Mehani <[email protected]>
shtrom added a commit to shtrom/AuroraPlusHA that referenced this pull request Aug 14, 2023
Waiting for LeighCurran/AuroraPlus#1 to be merged.

Signed-off-by: Olivier Mehani <[email protected]>
@shtrom shtrom mentioned this pull request Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant