From 96b508409236f49ef5336f48e0e9be5e5f7b8261 Mon Sep 17 00:00:00 2001 From: sworld Date: Sun, 22 Dec 2024 22:23:50 +0800 Subject: [PATCH] fix: i18n type error --- custom_components/xiaomi_home/miot/miot_i18n.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/xiaomi_home/miot/miot_i18n.py b/custom_components/xiaomi_home/miot/miot_i18n.py index 5f11694..152bc08 100644 --- a/custom_components/xiaomi_home/miot/miot_i18n.py +++ b/custom_components/xiaomi_home/miot/miot_i18n.py @@ -71,7 +71,7 @@ class MIoTI18n: ) -> None: self._main_loop = loop or asyncio.get_event_loop() self._lang = lang - self._data = None + self._data = {} async def init_async(self) -> None: if self._data: @@ -94,7 +94,7 @@ class MIoTI18n: self._data = data async def deinit_async(self) -> None: - self._data = None + self._data = {} def translate( self, key: str, replace: Optional[dict[str, str]] = None