Skip to content
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

Fix invalid escape sequence #85

Merged
merged 4 commits into from
Apr 11, 2024
Merged

Conversation

Santobert
Copy link
Contributor

@Santobert Santobert commented Apr 4, 2024

With the current release home assistant logs a warning:

Logger: py.warnings
Quelle: components/neato/init.py:6
Erstmals aufgetreten: 18:38:05 (1 Vorkommnisse)
Zuletzt protokolliert: 18:38:05

/usr/local/lib/python3.12/site-packages/pybotvac/robot.py:141: SyntaxWarning: invalid escape sequence '\d' endpoint=re.sub(":\d+", "", endpoint), # noqa: W605, Remove port number

The fix was to declare a string explicitly as regex in robots.py, line 144:

From this:

        self._url = "{endpoint}/vendors/{vendor_name}/robots/{serial}/messages".format(
            endpoint=re.sub(":\d+", "", endpoint),  # noqa: W605, Remove port number
            vendor_name=vendor.name,
            serial=self.serial,
        )

To this:

        self._url = "{endpoint}/vendors/{vendor_name}/robots/{serial}/messages".format(
            endpoint=re.sub(r":\d+", "", endpoint),  # Remove port number
            vendor_name=vendor.name,
            serial=self.serial,
        )

Unfortunately, I had to fix some technical debt to keep the CI happy, and so this PR grew. I only did the most important things to get the CI up and running, but it would need some more maintenance, which is not included in this PR.

@Santobert
Copy link
Contributor Author

@stianaske do you mind having a look :)

@stianaske stianaske merged commit d6deb8c into stianaske:master Apr 11, 2024
1 check passed
@stianaske
Copy link
Owner

LGTM! Thanks for fixing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants