mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-11-26 12:45:26 +01:00
fixes connection isssue#87 (#105)
This commit is contained in:
parent
2e22b232fb
commit
ae4137364e
@ -187,8 +187,10 @@ async def _async_resolve_host_getaddrinfo(
|
|||||||
eventloop: asyncio.events.AbstractEventLoop, host: str, port: int
|
eventloop: asyncio.events.AbstractEventLoop, host: str, port: int
|
||||||
) -> List[AddrInfo]:
|
) -> List[AddrInfo]:
|
||||||
try:
|
try:
|
||||||
# Limit to TCP IP protocol
|
# Limit to TCP IP protocol and SOCK_STREAM
|
||||||
res = await eventloop.getaddrinfo(host, port, proto=socket.IPPROTO_TCP)
|
res = await eventloop.getaddrinfo(
|
||||||
|
host, port, type=socket.SOCK_STREAM, proto=socket.IPPROTO_TCP
|
||||||
|
)
|
||||||
except OSError as err:
|
except OSError as err:
|
||||||
raise APIConnectionError("Error resolving IP address: {}".format(err))
|
raise APIConnectionError("Error resolving IP address: {}".format(err))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user