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 tzdata requirement #322

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sander-visser
Copy link

Observed tzdata is required on clean 3.12.7 install

Observed tzdata is required on clean 3.12.7 install
@Danielhiversen
Copy link
Owner

@sander-visser
Copy link
Author

If I run:
python -m pip uninstall tzdata

I get an error running the example:

File "PATH\site-packages\tibber_init_.py", line 66, in init
self.time_zone: dt.tzinfo = time_zone or zoneinfo.ZoneInfo("UTC")
^^^^^^^^^^^^^^^^^^^^^^^^
File "PATH\Lib\zoneinfo_common.py", line 24, in load_tzdata
raise ZoneInfoNotFoundError(f"No time zone found with key {key}")
zoneinfo._common.ZoneInfoNotFoundError: 'No time zone found with key UTC'

@sander-visser
Copy link
Author

If I init with time_zone=datetime.timezone.utc then tzdata is not required - maybe you can fallback on that instead...

@sander-visser
Copy link
Author

Using you py package to analyze my peak power usage excl EV charging (looking forward to you merging access to more historic consumption (by setting start data towards tibber api)

https://github.com/sander-visser/py-playground/blob/main/tibber_easee_peak_power_analyzer.py

python c:\Temp\tibber_easee_peak_power.py
Scanning home of Sander Visser
Scanning peak power from 2024-10-20 21:00:00Z to 2024-11-20 20:00:00Z
Found power peak 5.535 kWh/h to have occured at 2024-11-20T02:00:00+00:00
Found power peak 5.496 kWh/h to have occured at 2024-11-08T01:00:00+00:00
Found power peak 5.092 kWh/h to have occured at 2024-10-30T03:00:00+00:00

@Danielhiversen
Copy link
Owner

I wonder if this is only needed for Windows?
Maybe it would be better to change to datetime.timezone.utc instead

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.

2 participants