mirror of
https://github.com/XiaoMi/ha_xiaomi_home.git
synced 2025-03-31 14:55:31 +08:00
fix: fix variable name or comment errors & fix test_lan error (#678)
Some checks are pending
Some checks are pending
* fix: renamed _url_addr_list to _http_addr_map for clarity * fix: redirected ping command output to DEVNULL * fix: add resource cleanup in test_lan_async
This commit is contained in:
parent
8fb6f9065e
commit
3a5b641ec7
@ -94,7 +94,7 @@ class MIoTNetwork:
|
||||
_main_loop: asyncio.AbstractEventLoop
|
||||
|
||||
_ip_addr_map: dict[str, float]
|
||||
_url_addr_list: dict[str, float]
|
||||
_http_addr_map: dict[str, float]
|
||||
_http_session: aiohttp.ClientSession
|
||||
|
||||
_refresh_interval: int
|
||||
@ -283,8 +283,8 @@ class MIoTNetwork:
|
||||
[
|
||||
'ping', '-c', '1', '-w',
|
||||
str(self._DETECT_TIMEOUT), address]),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE
|
||||
stdout=subprocess.DEVNULL,
|
||||
stderr=subprocess.DEVNULL
|
||||
)
|
||||
await process.communicate()
|
||||
if process.returncode == 0:
|
||||
|
@ -56,7 +56,7 @@ async def test_lan_async(test_devices: dict):
|
||||
|
||||
# Your central hub gateway did
|
||||
test_did = '111111'
|
||||
# Your central hub gateway did
|
||||
# Your central hub gateway token
|
||||
test_token = '11223344556677d9a03d43936fc384205'
|
||||
test_model = 'xiaomi.gateway.hub1'
|
||||
# Your computer interface list, such as enp3s0, wlp5s0
|
||||
@ -152,3 +152,5 @@ async def test_lan_async(test_devices: dict):
|
||||
await asyncio.sleep(0.2)
|
||||
|
||||
await miot_lan.deinit_async()
|
||||
await mips_service.deinit_async()
|
||||
await miot_network.deinit_async()
|
||||
|
Loading…
x
Reference in New Issue
Block a user