Skip to content

Commit

Permalink
Initialize code_slot and dow to None
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuffy2 committed Dec 28, 2024
1 parent ab493a6 commit 7fbaae5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/keymaster/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ def __init__(self, entity_description: KeymasterEntityDescription) -> None:
f"{self._config_entry.entry_id}_{slugify(self._property)}"
)
# _LOGGER.debug(f"[Entity init] self._property: {self._property}, unique_id: {self.unique_id}")
self._code_slot: None | int = None
if ".code_slots" in self._property:
self._code_slot: None | int = self._get_code_slots_num()
self._code_slot = self._get_code_slots_num()
self._day_of_week_num: None | int = None
if "accesslimit_day_of_week" in self._property:
self._day_of_week_num: None | int = self._get_day_of_week_num()
self._day_of_week_num = self._get_day_of_week_num()
self._attr_extra_state_attributes: dict[str, Any] = {}
self._attr_device_info: DeviceInfo = {
"identifiers": {(DOMAIN, self._config_entry.entry_id)},
Expand Down

0 comments on commit 7fbaae5

Please sign in to comment.