mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2026-01-17 07:10:44 +08:00
style: rename spec_filter func name
This commit is contained in:
parent
470215b093
commit
45b4a2b380
@ -1082,7 +1082,7 @@ class MIoTSpecParser:
|
|||||||
# Set translation cache
|
# Set translation cache
|
||||||
await self._multi_lang.set_spec_async(urn=urn_key)
|
await self._multi_lang.set_spec_async(urn=urn_key)
|
||||||
# Set spec filter
|
# 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
|
# Parse device type
|
||||||
spec_instance: MIoTSpecInstance = MIoTSpecInstance(
|
spec_instance: MIoTSpecInstance = MIoTSpecInstance(
|
||||||
urn=urn, name=urn_strs[3],
|
urn=urn, name=urn_strs[3],
|
||||||
|
|||||||
@ -848,7 +848,7 @@ class SpecFilter:
|
|||||||
self._cache = None
|
self._cache = None
|
||||||
self._data = 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."""
|
"""MUST call init_async() first."""
|
||||||
if not self._data:
|
if not self._data:
|
||||||
return
|
return
|
||||||
@ -856,7 +856,7 @@ class SpecFilter:
|
|||||||
|
|
||||||
def filter_service(self, siid: int) -> bool:
|
def filter_service(self, siid: int) -> bool:
|
||||||
"""Filter service by siid.
|
"""Filter service by siid.
|
||||||
MUST call init_async() and filter_spec() first."""
|
MUST call init_async() and set_spec_spec() first."""
|
||||||
if (
|
if (
|
||||||
self._cache
|
self._cache
|
||||||
and 'services' in self._cache
|
and 'services' in self._cache
|
||||||
@ -870,7 +870,7 @@ class SpecFilter:
|
|||||||
|
|
||||||
def filter_property(self, siid: int, piid: int) -> bool:
|
def filter_property(self, siid: int, piid: int) -> bool:
|
||||||
"""Filter property by piid.
|
"""Filter property by piid.
|
||||||
MUST call init_async() and filter_spec() first."""
|
MUST call init_async() and set_spec_spec() first."""
|
||||||
if (
|
if (
|
||||||
self._cache
|
self._cache
|
||||||
and 'properties' in self._cache
|
and 'properties' in self._cache
|
||||||
@ -883,7 +883,7 @@ class SpecFilter:
|
|||||||
|
|
||||||
def filter_event(self, siid: int, eiid: int) -> bool:
|
def filter_event(self, siid: int, eiid: int) -> bool:
|
||||||
"""Filter event by eiid.
|
"""Filter event by eiid.
|
||||||
MUST call init_async() and filter_spec() first."""
|
MUST call init_async() and set_spec_spec() first."""
|
||||||
if (
|
if (
|
||||||
self._cache
|
self._cache
|
||||||
and 'events' in self._cache
|
and 'events' in self._cache
|
||||||
@ -897,7 +897,7 @@ class SpecFilter:
|
|||||||
|
|
||||||
def filter_action(self, siid: int, aiid: int) -> bool:
|
def filter_action(self, siid: int, aiid: int) -> bool:
|
||||||
""""Filter action by aiid.
|
""""Filter action by aiid.
|
||||||
MUST call init_async() and filter_spec() first."""
|
MUST call init_async() and set_spec_spec() first."""
|
||||||
if (
|
if (
|
||||||
self._cache
|
self._cache
|
||||||
and 'actions' in self._cache
|
and 'actions' in self._cache
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user