Describe the bug
If you query HQ close to midnight, data is still being rolled out.
One corner case is already taken care of (yesterday - 1).
But, HQ will release the consumption without average_temperature.
If you query during this interval, you get None and code can crash.
Traceback (most recent call last):
File "/usr/local/bin/pyhydroquebec", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/pyhydroquebec/__main__.py", line 168, in main
output_text(results[0], args.hourly)
File "/usr/local/lib/python3.7/site-packages/pyhydroquebec/outputter.py", line 24, in output_text
print(YESTERDAY_TPL.format(d=data))
TypeError: unsupported format string passed to NoneType.__format__
To Reproduce
Run the std use case
pyhydroquebec -u XXX -p XXX
Expected behavior
No errors. :)
PyHydroQuebec and Python version
Python 3.7.5
PyHydroQuebec 3.0.0 (master as of today)
Corner Cases
Are you in one of this situations:
[ ] Change of address
[ ] Change of rate
[ ] Add a new contract
[ ] Remove an old contract
[ ] No
[X] Other: query close to midnight (2AM in my test)
Describe the bug If you query HQ close to midnight, data is still being rolled out. One corner case is already taken care of (yesterday - 1). But, HQ will release the consumption without average_temperature.
If you query during this interval, you get None and code can crash.
To Reproduce Run the std use case
Expected behavior No errors. :)
PyHydroQuebec and Python version Python 3.7.5 PyHydroQuebec 3.0.0 (master as of today)
Corner Cases Are you in one of this situations: