New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log out of Sagemcom client after every query #30
Conversation
Please note that this needs #18 to work properly. The current status: I'm seeing Devices and Entities get created. |
Awesome! I wonder if we need to logout after every query, or just relogin() when the exception is thrown. Wouldn't that make it even easier? (and allows other routers to keep the session alive. My router for example can keep the session open, reducing the amount of logins and resources required). |
The way it is set up currently is that it is trying to log-in at least twice, which is causing the max-sessions exceptions. Keeping the session open (in HA) will mean that it becomes impossible to log in to the device manually, which I find a big downside. All in all, I find that logging out after doing the query keeps it very local in code and allows me to manually log in to the device (breaking HA for a short while, which is acceptable and automatically recovers once I manually log out).
I'm not exactly sure what exception you are referring to (once we see the max-session error logging in again isn't possible). |
@iMicknl Is there anything you would like me to update before moving this PR forward? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! And sorry for the late merge.
I am not a huge fan of logging out after every query and I think that this perhaps should be an option (or auto detected based on the type / model / exceptions). But let's merge it to unblock you and the other user, and we can always see if other users face issues.
Since the F5359 device (KPN Box v12) only allows one client connected at a time, we need to logout after every query.