-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make get_readings return a list of namedtuples
- Loading branch information
Showing
3 changed files
with
13 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,17 +104,17 @@ with elicznik.ELicznik("[email protected]", "secretpassword", "optional_site_id | |
readings = m.get_readings(datetime.date(2021, 7, 1), datetime.date(2021, 7, 31)) | ||
for timestamp, consumed, produced in readings: | ||
print(timestamp, consumed, produced) | ||
for timestamp, consumed, produced, consumed_net, produced_net in readings: | ||
print(timestamp, consumed, produced, consumed_net, produced_net) | ||
# single day | ||
print("Yesterday") | ||
yesterday = datetime.date.today() - datetime.timedelta(days=1) | ||
readings = m.get_readings(yesterday) | ||
for timestamp, consumed, produced in readings: | ||
print(timestamp, consumed, produced) | ||
for timestamp, consumed, produced, consumed_net, produced_net in readings: | ||
print(timestamp, consumed, produced, consumed_net, produced_net) | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters