-
-
Notifications
You must be signed in to change notification settings - Fork 44
Index out of range #29
Comments
Hi, I looked the code at the line 334 and it seem to try to get the value at position 0 of the array Json_Ouput['result'] and then get an error because the array seem to be empty. I modified the code to add a verification that the length of the arrary is >1 and if not then to do the same thing if the temperature data was missing.
It seem to work for me! |
This issue seems already fixed, see here: https://github.com/titilambert/pyhydroquebec/blob/master/pyhydroquebec/client.py#L341 |
I can confirm the the code you just linked dosn't work (event in 2.4.0). You look if you get a result, but not if the result contain any data, for some rease the temperature was n/d today so the program got an array but an array of size 0 so when he try to look for the data at position 0 its throwing an out of bound. |
I really don't understand your patch :/ The issue should be handled by
This is really strange... Could you add :
To see the value of the variable ? Thanks ! |
The |
I'm really not sure of that.
|
python3 -c "print('EMPTY') if not [] else print('NOT EMPTY')" EMPTY |
Here the print value : {'success': True, 'results': []} So in this case i think the Get the result from sucess : true and not the result [] |
I'm closing this issue because of the Hydroquebec update see #35 |
Describe the bug
Error when trying to get the data from HydroQuebec
To Reproduce
The command pyhydroquebec -u username -p password (-j and witouth -j) return an error
Seem linked to the fact that HydroQuebec dosn't register all the data yesterday
The text was updated successfully, but these errors were encountered: