xZetsubou / hass-localtuya

🔹 A Home Assistant integration to handle Tuya devices locally "fork from localtuya"
https://xzetsubou.github.io/hass-localtuya/
GNU General Public License v3.0
287 stars 30 forks source link

[Bug]: reuse_port not supported by socket module #273

Open RichardtGit opened 3 weeks ago

RichardtGit commented 3 weeks ago

LocalTuya Version

2024.6.0

Home Assistant Version

2024.4.3

Environment

What happened?

Auto Discovery of devices not working

Steps to reproduce.

  1. Add new device
  2. error: Something failed when discovering devices. See log for details. If problem persists, create a new issue (including debug logs).
  3. Can only manually add new devices

Relevant log output

Logger: custom_components.localtuya.config_flow
Source: C:\HassWP_2024.4.3\config\custom_components\localtuya\config_flow.py:963
integration: LocalTuya (documentation, issues)
First occurred: 8:26:57 PM (2 occurrences)
Last logged: 8:28:33 PM

discovery failed: reuse_port not supported by socket module
Traceback (most recent call last):
  File "C:\HassWP_2024.4.3\config\custom_components\localtuya\config_flow.py", line 956, in discover_devices
    discovered_devices = await discover()
                         ^^^^^^^^^^^^^^^^
  File "C:\HassWP_2024.4.3\config\custom_components\localtuya\discovery.py", line 124, in discover
    await discovery.start()
  File "C:\HassWP_2024.4.3\config\custom_components\localtuya\discovery.py", line 78, in start
    self._listeners = await asyncio.gather(listener, encrypted_listener)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\HassWP_2024.4.3\python-3.12.3.amd64\Lib\asyncio\base_events.py", line 1400, in create_datagram_endpoint
    _set_reuseport(sock)
  File "C:\HassWP_2024.4.3\python-3.12.3.amd64\Lib\asyncio\base_events.py", line 92, in _set_reuseport
    raise ValueError('reuse_port not supported by socket module')
ValueError: reuse_port not supported by socket module

Diagnostics information.

No response

xZetsubou commented 3 weeks ago

If you're running HA on Windows then go to file custom_components\localtuya\discovery.py on line 70 and line 73 remove reuse_port=True

RichardtGit commented 3 weeks ago

Thanks will do that.

Much appreciated

Solved the problem

On Wed, 12 Jun 2024, 02:36 Bander, @.***> wrote:

If you're running HA on Windows then go to file custom_components\localtuya\discovery.py on line 70 and line 73 remove reuse_port=True

— Reply to this email directly, view it on GitHub https://github.com/xZetsubou/hass-localtuya/issues/273#issuecomment-2161848148, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZFNAIZ6JLZ3VBGM4FURJTLZG6J2DAVCNFSM6AAAAABJE4QOQSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRRHA2DQMJUHA . You are receiving this because you authored the thread.Message ID: @.***>