Allow port reuse so that other integrations can read the same port (#1481)

Co-authored-by: rospogrigio <[email protected]>
This commit is contained in:
Luke Bonaccorsiandrospogrigio authored and GitHub committed 2023-09-12 17:10:28 +02:00
1 parent 25105427b8
commit 23b0cfde6d
1 file changed
+2 -2
+2 -2
View File
@@ -43,10 +43,10 @@ class TuyaDiscovery(asyncio.DatagramProtocol):
"""Start discovery by listening to broadcasts."""
loop = asyncio.get_running_loop()
listener = loop.create_datagram_endpoint(
lambda: self, local_addr=("0.0.0.0", 6666)
lambda: self, local_addr=("0.0.0.0", 6666), reuse_port=True
)
encrypted_listener = loop.create_datagram_endpoint(
lambda: self, local_addr=("0.0.0.0", 6667)
lambda: self, local_addr=("0.0.0.0", 6667), reuse_port=True
)
self._listeners = await asyncio.gather(listener, encrypted_listener)