ooii / pySuez

Get your water consumption data from your Suez account (www.toutsurmoneau.fr)
Apache License 2.0
8 stars 12 forks source link

Follow URL redirects and get Cookie from correct provider #18

Closed ybizeul closed 8 months ago

ybizeul commented 1 year ago

This PR follows the correct redirect from toutsurmoneau.fr to the end provider for the logged in user.

It should get the data from end provider transparently without having to configure your provider.

Apparently, all is needed is to allow redirect during the POST request when getting the cookie, and get the value of the new cookie for the redirected web site.

All subsequent requests can go to toutsurmoneau.fr as long as the cookie has been generated by the provider domain.

It should fix #14 and #16

Kelesis commented 1 year ago

Very good analysis! I confirm this PR is ok for my sub provider too, and should indeed work for any other provider without the need to add any new parameter nor sub URL. @ooii hope you'll find some time to consider this PR for a merge 🙏

PS: Here is an example of what can be done within Home Assistant with these data. Screenshot_20230204-173551

ybizeul commented 1 year ago

@ooii Can you review this PR ?

ooii commented 8 months ago

@ooii Can you review this PR ?

Of course 😅