From 7fbaae5258390c9947cced2abd375d3c479bc1b2 Mon Sep 17 00:00:00 2001 From: Snuffy2 Date: Fri, 27 Dec 2024 21:44:06 -0500 Subject: [PATCH] Initialize code_slot and dow to None --- custom_components/keymaster/entity.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom_components/keymaster/entity.py b/custom_components/keymaster/entity.py index d98331c2..eefb89fc 100644 --- a/custom_components/keymaster/entity.py +++ b/custom_components/keymaster/entity.py @@ -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)},