Skip to content

Fix multi-interface discovery and restore manual setup option in Polish UI#426

Open
valutcizen wants to merge 1 commit intoRobHofmann:masterfrom
valutcizen:master
Open

Fix multi-interface discovery and restore manual setup option in Polish UI#426
valutcizen wants to merge 1 commit intoRobHofmann:masterfrom
valutcizen:master

Conversation

@valutcizen
Copy link
Copy Markdown

This PR fixes Gree device discovery on hosts with multiple network interfaces.

Previously, discovery used a single UDP socket bound to the default route, which meant broadcast packets were effectively sent only through the default network interface. As a result, devices reachable through other interfaces or subnets were not discovered reliably.

This change updates discovery to:

  • enumerate active IPv4 interfaces,
  • create a dedicated broadcast socket per interface,
  • send discovery packets from each interface separately,
  • listen for responses across all discovery sockets,
  • deduplicate devices discovered through multiple paths.

Additionally, this PR updates the Polish translation for the config flow so the initial setup screen correctly exposes both setup methods:

  • automatic discovery,
  • manual device setup.

Why this matters

  • fixes discovery in multi-homed Home Assistant environments,
  • improves support for setups with VLANs, multiple NICs, or separate LAN segments,
  • restores a clear manual fallback path for Polish-speaking users.

Files changed

  • custom_components/gree/gree_protocol.py
  • custom_components/gree/translations/pl.json

Validation

  • verified Python syntax with python3 -m py_compile
  • manually reviewed config flow and translation mapping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant