mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-11-22 12:05:12 +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
|
||||
) -> List[AddrInfo]:
|
||||
try:
|
||||
# Limit to TCP IP protocol
|
||||
res = await eventloop.getaddrinfo(host, port, proto=socket.IPPROTO_TCP)
|
||||
# Limit to TCP IP protocol and SOCK_STREAM
|
||||
res = await eventloop.getaddrinfo(
|
||||
host, port, type=socket.SOCK_STREAM, proto=socket.IPPROTO_TCP
|
||||
)
|
||||
except OSError as err:
|
||||
raise APIConnectionError("Error resolving IP address: {}".format(err))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user