Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Add M rate support #44

Open
k-forest-hd-energy opened this issue Nov 8, 2019 · 6 comments
Open

Add M rate support #44

k-forest-hd-energy opened this issue Nov 8, 2019 · 6 comments

Comments

@k-forest-hd-energy
Copy link

The fetch summary method cannot work when a customer object can have multiple contracts.

Here you can see an example for one of my client number. He has 2 different accounts on the same client number:

image

Also, to see the contract number you need to click on the (+) button next to "Electricité fournie à 1 adresse". This trigger an ajax request with get at https://cl-ec-spring.hydroquebec.com/portail/fr/group/clientele/gerer-mon-compte/actionAfficherLieuxDeConsoAjax?ncc=$accountNumber

The contrat number will be inside that response

Here is a stack trace of the current error:

'NoneType' object has no attribute 'text' File "/mnt/c/Users/kevmegforest/workspace/hydroquebec_puller/job/src/hydroquebec_puller/__main__.py", line 77, in main results = loop.run_until_complete(asyncio.gather(async_func)) File "/usr/lib/python3.7/asyncio/base_events.py", line 579, in run_until_complete return future.result() File "/mnt/c/Users/kevmegforest/workspace/hydroquebec_puller/job/src/env/lib/python3.7/site-packages/pyhydroquebec/__main__.py", line 65, in fetch_data_detailled_energy_use await client.login() File "/mnt/c/Users/kevmegforest/workspace/hydroquebec_puller/job/src/env/lib/python3.7/site-packages/pyhydroquebec/client.py", line 231, in login await customer.fetch_summary() File "/mnt/c/Users/kevmegforest/workspace/hydroquebec_puller/job/src/env/lib/python3.7/site-packages/pyhydroquebec/customer.py", line 61, in fetch_summary raw_contract_id = soup.find('div', {'class': 'contrat'}).text None

@titilambert
Copy link
Owner

Hello,
This should work, I was working on my account and I add 2 contracts.
Could you give me more details on your contracts ?
Which contract types do you have ? D/DT/ other?

@k-forest-hd-energy
Copy link
Author

k-forest-hd-energy commented Dec 22, 2019 via email

@titilambert
Copy link
Owner

I guess that's why, I never had the chance to test with a rate M :/
Let me change the title of your issue

@titilambert titilambert changed the title Multiple contracts on same client not working Add M rate support Dec 22, 2019
@titilambert
Copy link
Owner

Unfortunately, I don't know how to test it. I would need a test account for that.
But HydroQuebec didn't answer to demand (providing me some test accounts for CI)... :(

@kevmegforest
Copy link
Contributor

Yes it can be hard to test without. I can perhaps help you with that. I have access to more than 100 clients. I should be able able to get a new mandatory letter for that specific client which have some issues. I just need that the information be kept somewhat confidential.

Send me a private message and I should be able to set it up.

@kevmegforest
Copy link
Contributor

I guess that's why, I never had the chance to test with a rate M :/
Let me change the title of your issue

Rate M works well for me. It's only for that specific case where there are multiple contracts attached to the same client number.

I don't know what happens on the residential side for that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants