diff --git a/custom_components/xiaomi_home/miot/miot_spec.py b/custom_components/xiaomi_home/miot/miot_spec.py index 5eaac98..cd778b2 100644 --- a/custom_components/xiaomi_home/miot/miot_spec.py +++ b/custom_components/xiaomi_home/miot/miot_spec.py @@ -1082,7 +1082,7 @@ class MIoTSpecParser: # Set translation cache await self._multi_lang.set_spec_async(urn=urn_key) # Set spec filter - self._spec_filter.filter_spec(urn_key=urn_key) + await self._spec_filter.set_spec_spec(urn_key=urn_key) # Parse device type spec_instance: MIoTSpecInstance = MIoTSpecInstance( urn=urn, name=urn_strs[3], diff --git a/custom_components/xiaomi_home/miot/miot_storage.py b/custom_components/xiaomi_home/miot/miot_storage.py index de02199..c60e9b3 100644 --- a/custom_components/xiaomi_home/miot/miot_storage.py +++ b/custom_components/xiaomi_home/miot/miot_storage.py @@ -848,7 +848,7 @@ class SpecFilter: self._cache = None self._data = None - def filter_spec(self, urn_key: str) -> None: + async def set_spec_spec(self, urn_key: str) -> None: """MUST call init_async() first.""" if not self._data: return @@ -856,7 +856,7 @@ class SpecFilter: def filter_service(self, siid: int) -> bool: """Filter service by siid. - MUST call init_async() and filter_spec() first.""" + MUST call init_async() and set_spec_spec() first.""" if ( self._cache and 'services' in self._cache @@ -870,7 +870,7 @@ class SpecFilter: def filter_property(self, siid: int, piid: int) -> bool: """Filter property by piid. - MUST call init_async() and filter_spec() first.""" + MUST call init_async() and set_spec_spec() first.""" if ( self._cache and 'properties' in self._cache @@ -883,7 +883,7 @@ class SpecFilter: def filter_event(self, siid: int, eiid: int) -> bool: """Filter event by eiid. - MUST call init_async() and filter_spec() first.""" + MUST call init_async() and set_spec_spec() first.""" if ( self._cache and 'events' in self._cache @@ -897,7 +897,7 @@ class SpecFilter: def filter_action(self, siid: int, aiid: int) -> bool: """"Filter action by aiid. - MUST call init_async() and filter_spec() first.""" + MUST call init_async() and set_spec_spec() first.""" if ( self._cache and 'actions' in self._cache