Skip to content

Commit

Permalink
Fix KeyError on uninitialised dict (#1984)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ authored Jan 14, 2025
1 parent 23d241a commit e94df46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Version 2025.1.6 (2025-01-14)

- Fix KeyError on uninitialised dict

# Version 2025.1.5 (2025-01-11)

- Refactor create\_\* methods:
Expand Down
4 changes: 2 additions & 2 deletions hahomematic/caches/persistent.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def __init__(self, central: hmcu.CentralUnit) -> None:
"""Init the paramset description cache."""
# {interface_id, {channel_address, paramsets}}
self._raw_paramset_descriptions: Final[dict[str, dict[str, dict[ParamsetKey, dict[str, ParameterData]]]]] = (
defaultdict(lambda: defaultdict(dict))
defaultdict(lambda: defaultdict(lambda: defaultdict(dict)))
)
super().__init__(
central=central,
Expand All @@ -293,7 +293,7 @@ def add(
paramset_description: dict[str, ParameterData],
) -> None:
"""Add paramset description to cache."""
self._raw_paramset_descriptions[interface_id][channel_address][paramset_key] = paramset_description
self._raw_paramset_descriptions[interface_id][channel_address][paramset_key].update(paramset_description)
self._add_address_parameter(channel_address=channel_address, paramsets=[paramset_description])

def remove_device(self, device: Device) -> None:
Expand Down
2 changes: 1 addition & 1 deletion hahomematic/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import re
from typing import Any, Final, NamedTuple, Required, TypedDict

VERSION: Final = "2025.1.5"
VERSION: Final = "2025.1.6"

# default
DEFAULT_CUSTOM_ID: Final = "custom_id"
Expand Down

0 comments on commit e94df46

Please sign in to comment.