Fix linky sensor login error#17110
Fix linky sensor login error#17110MartinHjelmare merged 8 commits intohome-assistant:devfrom Debaru:dev
Conversation
| from pylinky.client import PyLinkyError | ||
| from pylinky.client import LinkyClient, PyLinkyError | ||
|
|
||
| client = LinkyClient(self._username, self._password) |
There was a problem hiding this comment.
You probably need to close the session after fetch_data().
See also pyLinky main.
finally:
client.close_session()
Adding following enhancements: * Make sure the platform loads correctly by making the first API request in setup_platform. * Close the session after each API call. * Use timeout parameter everywhere.
Make platform fail-safe
| from pylinky.client import PyLinkyError | ||
| from pylinky.client import LinkyClient, PyLinkyError | ||
|
|
||
| client = LinkyClient(self._username, self._password, None, self._timeout) |
Fix Hound CI error: line too long.
|
Please add to the PR description, why this change solves the issue. |
| from pylinky.client import PyLinkyError | ||
| from pylinky.client import LinkyClient, PyLinkyError | ||
|
|
||
| client = LinkyClient(self._username, self._password, None, |
There was a problem hiding this comment.
Why do we need to create a new client on every update?
There was a problem hiding this comment.
First solution use one client, created in setup_platform, but it's seems to not work (Login error).
With a new client on every update, that resolve the issue.
There was a problem hiding this comment.
It would be good to know why.
There was a problem hiding this comment.
I agree with you.
My solution was a hotfix what work for me and closing error login issue, it's why i share it. In wait I've found a better solution, do you want I cancel my PR ?
There was a problem hiding this comment.
We shouldn't necessarily close this. Let's hear what other reviewers think. If this PR fixes the problem, that's a first step.
There was a problem hiding this comment.
I can confirm that this fixes the original issue.
I have tried to re-use the client, but the original error occurs again.
It seems that the session cannot be re-used. Then this might be an issue in the pyLinky library.
There was a problem hiding this comment.
After some tests, I agree with @hobbe : pyLinky library session cannot be re-used.
So, for now, we need to re-create an client at each update.
There was a problem hiding this comment.
I suggest that you open an issue for pyLinky to get it fixed.
There was a problem hiding this comment.
I've open a PR on pyLinly library to improve client (Pirionfr/pyLinky#5).
|
Can this fix be pushed to 0.80 as this component is not working since its release in 0.79? |
| def update(self): | ||
| """Fetch new state data for the sensor.""" | ||
| from pylinky.client import PyLinkyError | ||
| from pylinky.client import LinkyClient, PyLinkyError |
There was a problem hiding this comment.
'pylinky.client.LinkyClient' imported but unused
|
Now, we are using last pyLink version (0.1.8) which allow to reuse client session. |
|
Hi ! I modified the python source file to expose the user and names, and I can guarantee they are valid. Trying to trace the execution, it seems that it fails finding the cookie iPlanetDirectoryPro. I checked with the debug options of my web browser, and locally I've got this cookie... One thing though, now, when connecting on the Enedis webpage, it doesn't bring you to your user space, but it rather do several redirections (during these redirections the cookie seems to be not accessible) and brings to you to the website welcome page (iPlanetDirectoryPro) is then available. Am I the only one with this issue ? |
|
Please open an issue if you suspect a bug. If you need help please use our help channels: Merged PRs should not be used for support or bug reports. Thanks! |
Description:
Fix linky sensor login error .
Related issue (if applicable): fixes #17077
Checklist:
tox. Your PR cannot be merged unless tests pass