Since fews years Suez has begun (maybe by law) to delegate water distribution to local sub providers.
When this happens, everything works the same way, but the base URI might change according to the sub provider one.
If not doing so, a call to the API might result into the error message "Issue with yesterday data" or something so.
Looking at the code I see this issue has already been met by some users and the 2 following lines have been added to client.py
(line ~45)
if self._provider == "Eau Olivet":
BASE_URI = 'https://www.eau-olivet.fr'
Now for my special case, everything is working fine if we add the 2 new following lines
if self._provider == "Whatever name I pass to -P option"
BASE_URI = 'https://eaudubaslanguedoc.toutsurmoneau.fr'
So I think there are or there will be many other cases in the future so can we imagine the following addition ?
- Add a new command line option let's say "-b" (for base URI) and having the ability to directly override the default one
This way it could leave a chance for users in this case to use this wonderful project ;)
So in my case I could call pysuez -u 'someone@gmail.com' -p 'topsecretpassword' -b 'https://eaudubaslanguedoc.toutsurmoneau.fr'
=> And after that, add this new option to the home assistant Lovelace Sensor ^^' (Because yes .. this is my final goal ! :)
I'm sorry could have done un pull request myself, but my computer just died ... (to much coding I guess) and my work computer, which I use to write this, do not let me access github ...
Anyway have a nice day and thank you for this useful work
Stéphane
Since fews years Suez has begun (maybe by law) to delegate water distribution to local sub providers.
When this happens, everything works the same way, but the base URI might change according to the sub provider one.
If not doing so, a call to the API might result into the error message "Issue with yesterday data" or something so.
Looking at the code I see this issue has already been met by some users and the 2 following lines have been added to client.py
(line ~45)
Now for my special case, everything is working fine if we add the 2 new following lines
So I think there are or there will be many other cases in the future so can we imagine the following addition ?
- Add a new command line option let's say "-b" (for base URI) and having the ability to directly override the default one
This way it could leave a chance for users in this case to use this wonderful project ;)
So in my case I could call pysuez -u 'someone@gmail.com' -p 'topsecretpassword' -b 'https://eaudubaslanguedoc.toutsurmoneau.fr'
=> And after that, add this new option to the home assistant Lovelace Sensor ^^' (Because yes .. this is my final goal ! :)
I'm sorry could have done un pull request myself, but my computer just died ... (to much coding I guess) and my work computer, which I use to write this, do not let me access github ...
Anyway have a nice day and thank you for this useful work
Stéphane