FL550 / dwd_weather

Deutscher Wetterdienst integration for Home-Assistant
MIT License
197 stars 13 forks source link

Error in LOG-File #156

Closed svensoltmann closed 1 month ago

svensoltmann commented 1 month ago

Version of home_assistant

Home Assistant Core: 2024.10.2 Supervisor: 2024.10.0 Operating System: 13.1 Frontend: 20241002.3

Version of the custom_component

v.2.1.15

Describe the bug

Error in LOG-File: Logger: py.warnings Quelle: custom_components/dwd_weather/connector.py:12 Integration: Deutscher Wetterdienst (Dokumentation, Probleme) Erstmals aufgetreten: 07:43:22 (2 Vorkommnisse) Zuletzt protokolliert: 07:43:22

/usr/local/lib/python3.12/site-packages/suntimes/suntimes.py:528: SyntaxWarning: invalid escape sequence '\ ' raise ValueError("Vérifiez le chemin : doit inclure / ou \ en fin de nom - Check the path: must include / or \ at the end of the name") /usr/local/lib/python3.12/site-packages/suntimes/suntimes.py:602: SyntaxWarning: invalid escape sequence '\ ' raise ValueError("Vérifiez le chemin : doit inclure / ou \ en fin de nom - Check the path: must include / or \ at the end of the name")

FL550 commented 1 month ago

Thanks for reporting. This seems however like an error in the underlying library suntimes as this error occurs already during the import of the module: Quelle: custom_components/dwd_weather/connector.py:12. The strange thing is, this library is on this version since July 2022 and I don't have this error. My guess is, it has something to do with your configured timezone. Do you have anything uncommon there?

svensoltmann commented 1 month ago

I have now changed the time setting from "Change server time zone (Europe/Berlin)" to "Use your local time zone (Europe/Berlin)". Now it works. Version of DWD Weather is now V. 2.1.17

frostbyte-ninja commented 5 days ago

I have now changed the time setting from "Change server time zone (Europe/Berlin)" to "Use your local time zone (Europe/Berlin)". Now it works. Version of DWD Weather is now V. 2.1.17

I'm pretty sure that this is unrelated. The warning occurs the first time suntimes.py is imported; after that, the .pyc is used, and the message no longer shows up until the cache is invalidated.

@FL550 The issue still exists, please consider fixing it. Possible workaround:

import warnings

with warnings.catch_warnings():
    warnings.filterwarnings("ignore", category=SyntaxWarning)
    from suntimes import SunTimes