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

SyntaxWarning: invalid escape sequence '\s' #411

Closed
vincent516 opened this issue Jan 2, 2025 · 9 comments
Closed

SyntaxWarning: invalid escape sequence '\s' #411

vincent516 opened this issue Jan 2, 2025 · 9 comments

Comments

@vincent516
Copy link

I am running iCloud3 v3.1.4.1 and this error appears in the Home Assist system log when I restart Home Assistant:

Logger: py.warnings
Source: custom_components/icloud3/helpers/entity_io.py:259
integration: iCloud3 v3: iDevice Tracker (documentation, issues)
First occurred: 5:47:23 PM (3 occurrences)
Last logged: 5:47:23 PM

:1: SyntaxWarning: invalid escape sequence '\s'

@Friedi1970
Copy link

Good day Gary. Unfortunately I have the same error, running icloud v3.1.4.2b2 and HA 2024.12.5. The problem occurred the first time yesterday at 20:51:21.

Best regards and a happy new year,
Marco

Dieser Fehler stammt von einer benutzerdefinierten Integration

Logger: py.warnings
Quelle: custom_components/icloud3/helpers/entity_io.py:260
Integration: iCloud3 v3 (Dokumentation, Probleme)
Erstmals aufgetreten: 4. Januar 2025 um 20:51:21 (4 Vorkommnisse)
Zuletzt protokolliert: 10:58:21

<string>:1: SyntaxWarning: invalid escape sequence '\s'
<string>:1: SyntaxWarning: invalid escape sequence '\ '

@gcobb321
Copy link
Owner

gcobb321 commented Jan 5, 2025

Ignore it. There is a character in a text field from the entity register that it’s being decoded incorrectly. I’ll try to add a test for it in the next update.

@Friedi1970
Copy link

Friedi1970 commented Jan 6, 2025

Ignore it.

Hard to ignore since icloud3 isn’t working.

@Friedi1970
Copy link

Ignore it.

Hard to ignore since icloud3 isn’t working.

OK. My mistake. I thought it doesn't work but it does. But unfortunately I got new entity ids with _2. I didn't do anything but suddenly my dashboard had errors due to the "new" entities.

@gcobb321
Copy link
Owner

gcobb321 commented Jan 7, 2025

@Friedi1970 HA adds the _2 if it’s internal tables think iCloud3 is already running when it starts up. I’m working on that now and can detect when HA does creates them, can rename it back to the correct one. I think the solution will be detect it, delete all sensors from the registry and set them up again. It should be simple to clear the tables but I need to find the hook HA is using to do it.

I’ll send you an updated patch module tomorrow to see if it fixes the \s issue without breaking anything.

@gcobb321
Copy link
Owner

gcobb321 commented Jan 7, 2025

@Friedi1970
I have completely redone the code that generates theSyntaxWarning: invalid escape sequence '\s' error message

Unzip the following zip file into the icloud3\helpers directory and restart HA.
patch_entity_io_v3.1.4.2b3.zip

@Friedi1970
Copy link

@gcobb321 I updated and no errors so far :) Thanks so much!

@gcobb321
Copy link
Owner

gcobb321 commented Jan 8, 2025

Excellent. I finally got the error message and it appears it was a Python compiler message, not code that was running. When I got it, the error was pointing to code that was commented out. I deleted that code and the message went away.

@gcobb321
Copy link
Owner

Fixed in v3.1.4.4

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

No branches or pull requests

3 participants