This repository has been archived by the owner on Apr 5, 2021. It is now read-only.
Swap to SleekXMPP-FS, a fork built specifically for sucks #67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I finally have a fix for both #62 and #45!
Problem Statement
If the user has the PYASN1 python library installed, sucks fails to function due to an error thrown in SleekXMPP about a day being out of range (#45). If a workaround is applied (fixing the bug in SleekXMPP or rolling back to 1.3.2), then sucks still fails to function due to at least one of the Ecovacs certificates being expired, causing SleekXMPP to abort. (#62)
A very simple way to work around both of these issues is to simply uninstall PYASN1 (it's only an optional dependency in SleekXMPP, and not installed by default) which will cause SleekXMPP to issue a warning that it is not validating the certificate, and sucks then works just fine. However, this is not an option for environments where sucks is being used as part of a larger project that requires PYASN1 for other parts of its functionality. This is why sucks has not functioned for Home Assistant users for at least 6 months now.
A Short Term Fix
As a short term fix, I have published a fork of SleekXMPP lovingly called "SleekXMPP for Sucks" which has the validation code disabled. This fork does exactly the same thing that SleekXMPP does when PYASN1 is not present (without issuing a warning.) You can see the entirety of the changes in the fork here: OverloadUT/SleekXMPP@de73c44
This is obviously not a great permanent solution. Unfortunately SleekXMPP has not published a new version since 2016, and trying to use the HEAD of the master branch shows that the changes since 2016 have broken Python 3.7 compatibility, and are in an unknown state of stability in general. Therefore, I think this is a passable solution to put in to sucks for now, while we take our time figuring out a longer term solution.
(Migrating to Slixmpp is something I'd like to explore, but when I tried it out, I found that it's not just a drop-in - a few things would need to change, and it would also change sucks's minimum Python version to 3.5 which would require discussion.)