style: rename spec_filter func name

This commit is contained in:
topsworld 2025-01-15 16:23:03 +08:00
parent 470215b093
commit 45b4a2b380
2 changed files with 6 additions and 6 deletions

View File

@ -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],

View File

@ -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