emcniece / bchydro Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
emcniece/hass-bchydro#5 (comment)
Another issue unfortunately... If I uncomment
usage = await a.get_usage(hourly=True)
or
usage = await a.get_usage(hourly=False)
I get this error. If using the primary account resolves this, I could wait for that instead.
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.7/site-packages/tenacity/_asyncio.py", line 45, in call
result = await fn(*args, **kwargs)
TypeError: get_usage() got an unexpected keyword argument 'hourly'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "test.py", line 16, in
asyncio.run(main())
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "test.py", line 8, in main
usage = await a.get_usage(hourly=True)
File "/home/pi/.local/lib/python3.7/site-packages/tenacity/_asyncio.py", line 79, in async_wrapped
return await fn(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/tenacity/_asyncio.py", line 42, in call
do = self.iter(retry_state=retry_state)
File "/home/pi/.local/lib/python3.7/site-packages/tenacity/init.py", line 373, in iter
six.raise_from(retry_exc, fut.exception())
File "", line 3, in raise_from
tenacity.RetryError: RetryError[<Future at 0x76196a70 state=finished raised TypeError>]
Hi @emcniece
Hope all is well!
It looks like something broke for my BC Hydro data pull. I'm receiving the error below.
It looks like I've received this since May 3, 2022.
Are you receiving this? Or have any ideas?
Thanks!
Traceback (most recent call last):
File "/home/pi/bchydro/daily.py", line 82, in
asyncio.run(main())
File "/usr/lib/python3.7/asyncio/runners.py", line 43, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/home/pi/bchydro/daily.py", line 40, in main
usage = await a.get_usage(hourly=False)
File "/home/pi/bchydro/bchydro/api.py", line 296, in get_usage
await self._refresh_if(not self.usage, hourly=hourly)
File "/home/pi/bchydro/bchydro/api.py", line 125, in _refresh_if
await self.refresh(hourly=hourly)
File "/home/pi/.local/lib/python3.7/site-packages/tenacity/_asyncio.py", line 79, in async_wrapped
return await fn(*args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/tenacity/_asyncio.py", line 42, in call
do = self.iter(retry_state=retry_state)
File "/home/pi/.local/lib/python3.7/site-packages/tenacity/init.py", line 360, in iter
return fut.result()
File "/usr/lib/python3.7/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "/usr/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/pi/.local/lib/python3.7/site-packages/tenacity/_asyncio.py", line 45, in call
result = await fn(*args, **kwargs)
File "/home/pi/bchydro/bchydro/api.py", line 230, in refresh
condition="application/xml" not in response.headers["content-type"],
KeyError: 'content-type'
The new BCHydroAlertDialogException
gets thrown even when the dialog is not visible: emcniece/hass-bchydro#5 (comment)
Check for a .hidden
class on the dialog before erroring!
Thanks for your work on this! What are the chances a future release could export the results in json?
This is a great for providing access to BC Hydro's data, since they do not have an API you can access directly.
The addition of the hourly interval data would be handy for some use cases.
Thanks for making this!
so I see this can access all of the Datapoints for the current month just wondering how datapoints are supposed to be retrieved.
await bch.refresh(hourly=True)
for each in bch.usage.electricity:
print(each)
that works but I am sure its not the intended way... and it may be a lack of sleep but I cannot decipher the intended way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.