Skip to content

Commit

Permalink
Slugify cache file name
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ committed Jan 21, 2025
1 parent 2110f82 commit 88f49ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
3 changes: 2 additions & 1 deletion hahomematic/caches/persistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion tests/bandit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ tests:
- B317
- B318
- B319
- B320
- B601
- B602
- B604
Expand Down

0 comments on commit 88f49ba

Please sign in to comment.