This commit is contained in:
GavinIves 2025-12-28 15:24:34 +00:00
parent 4c7b6d570d
commit f5bc880c62
2 changed files with 1 additions and 2 deletions

View File

@ -716,7 +716,7 @@ class MIoTClient:
# props_list = [{'did': str, 'siid': int, 'piid': int, 'value': Any}......] # props_list = [{'did': str, 'siid': int, 'piid': int, 'value': Any}......]
# 判断是不是只有一个did # 判断是不是只有一个did
did_set = {prop["did"] for prop in props_list} did_set = {prop["did"] for prop in props_list}
if len(did_set) == 1: if len(did_set) != 1:
raise MIoTClientError(f"more than one or no did once, {did_set}") raise MIoTClientError(f"more than one or no did once, {did_set}")
did = did_set.pop() did = did_set.pop()

View File

@ -922,7 +922,6 @@ class MIoTLan:
async def __call_api_async( async def __call_api_async(
self, did: str, msg: dict, timeout_ms: int = 10000 self, did: str, msg: dict, timeout_ms: int = 10000
) -> dict: ) -> dict:
def call_api_handler(msg: dict, fut: asyncio.Future): def call_api_handler(msg: dict, fut: asyncio.Future):
self._main_loop.call_soon_threadsafe( self._main_loop.call_soon_threadsafe(
fut.set_result, msg) fut.set_result, msg)