Launched home assistant in docker from QNAP NAS. The NAS already have internal UDP discovery and when the daikin.py is used, i have this error
Traceback (most recent call last):
File "/usr/src/app/homeassistant/components/discovery.py", line 168, in scan_devices
results = await hass.async_add_job(_discover, netdisco)
File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/app/homeassistant/components/discovery.py", line 194, in _discover
netdisco.scan()
File "/usr/local/lib/python3.6/site-packages/netdisco/discovery.py", line 69, in scan
self.daikin.scan()
File "/usr/local/lib/python3.6/site-packages/netdisco/daikin.py", line 25, in scan
self.update()
File "/usr/local/lib/python3.6/site-packages/netdisco/daikin.py", line 39, in update
sock.bind(("", UDP_SRC_PORT))
OSError: [Errno 98] Address already in use
Adding sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) just below sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) fixed the problem.
Launched home assistant in docker from QNAP NAS. The NAS already have internal UDP discovery and when the daikin.py is used, i have this error
Adding
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
just belowsock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
fixed the problem.