diff --git a/changelog.md b/changelog.md index 39ebce2b..feeb5ca2 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # Version 2025.1.11 (2025-01-20) - Delay start of scheduler until devices are created +- Slugify cache file name # Version 2025.1.10 (2025-01-17) diff --git a/hahomematic/caches/persistent.py b/hahomematic/caches/persistent.py index 78178a08..e5589091 100644 --- a/hahomematic/caches/persistent.py +++ b/hahomematic/caches/persistent.py @@ -14,6 +14,7 @@ from typing import Any, Final import orjson +from slugify import slugify from hahomematic import central as hmcu from hahomematic.const import ( @@ -55,7 +56,7 @@ def __init__( self._save_load_semaphore: Final = asyncio.Semaphore() self._central: Final = central self._cache_dir: Final = f"{central.config.storage_folder}/{CACHE_PATH}" - self._filename: Final = f"{central.name}_{self._file_postfix}" + self._filename: Final = f"{slugify(central.name)}_{self._file_postfix}" self._persistent_cache: Final = persistent_cache self.last_save_triggered: datetime = INIT_DATETIME self.last_hash_saved = hash_sha256(value=persistent_cache) diff --git a/tests/bandit.yaml b/tests/bandit.yaml index 46566cc9..4a8cda72 100644 --- a/tests/bandit.yaml +++ b/tests/bandit.yaml @@ -12,7 +12,6 @@ tests: - B317 - B318 - B319 - - B320 - B601 - B602 - B604