Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup wizard: Add primary IP config #2565

Merged
merged 7 commits into from
May 7, 2024

Conversation

mherwege
Copy link
Contributor

@mherwege mherwege commented May 6, 2024

Add-on finders scan the network for devices supported by OH add-ons to suggest suitable add-ons. These are presented in the setup-wizard (and add-ons store).

To limit network traffic, especially for ip broadcast and multicast, finders could limit the traffic to one subnet. This is especially relevant if the setup would be on servers with many network interfaces or when using Docker. The broadcast address can be controlled through network settings. However, these network settings so far are only accessible through the UI after initial setup.
If the broadcast address or primary IP address is not set, one will be used from the list randomly.

This PR adds one step in the setup process, setting up a primary IP address. This will automatically also default the broadcast address to the broadcast address of the primary IP subnet. Querying the suggestion finder service for add-on suggestions is delayed until after this step, and some delay is built into the process to allow suggestions finders to scan the network.

See discussion in openhab/openhab-core#4036

image image

mherwege added 2 commits May 6, 2024 17:22
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
Copy link

relativeci bot commented May 6, 2024

#1946 Bundle Size — 10.59MiB (+0.07%).

6dde8bb(current) vs 3fa3192 main#1945(baseline)

Warning

Bundle contains 2 duplicate packages – View duplicate packages

Bundle metrics  Change 7 changes Regression 2 regressions
                 Current
#1946
     Baseline
#1945
Regression  Initial JS 1.86MiB(~+0.01%) 1.86MiB
No change  Initial CSS 607.87KiB 607.87KiB
Change  Cache Invalidation 17.97% 17.76%
Change  Chunks 223(+0.45%) 222
Change  Assets 246(+0.41%) 245
Change  Modules 2876(+0.1%) 2873
Regression  Duplicate Modules 149(+2.05%) 146
Change  Duplicate Code 1.86%(+1.09%) 1.84%
No change  Packages 95 95
No change  Duplicate Packages 2 2
Bundle size by type  Change 2 changes Regression 2 regressions
                 Current
#1946
     Baseline
#1945
Regression  JS 8.78MiB (+0.09%) 8.78MiB
Regression  CSS 890.75KiB (+0.01%) 890.63KiB
No change  Fonts 526.1KiB 526.1KiB
No change  Media 295.6KiB 295.6KiB
No change  IMG 140.74KiB 140.74KiB
No change  HTML 1.24KiB 1.24KiB
No change  Other 871B 871B

Bundle analysis reportBranch mherwege:primary_ip_configProject dashboard

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general looks good to me, however there are a few points I will take care of:

  • Seems like something went wrong when rebasing my changes from Setup wizard: Refactor add-on selection & Add descriptions for JS Scripting & Astro #2556 (I will clean-up the re-added code).
  • Use parameter-options for primary network selection: This makes only one of the network interfaces selectable and improves consistency with the actual network settings.
  • Refactor API call logic to use one big Promise.all (makes the code more readable and loading more predictable).
  • Handle locale change for the add-on selection inside the addon-setup-wizard component (related to the code clean-up above).
  • Fix an issue, where suggestions were not applied when an add-on tab was opened before the suggestions were loaded (I have used some event handling to fix that issue).

@florian-h05 florian-h05 changed the title Setup Wizard: primary ip config Setup wizard: Add primary IP config May 7, 2024
@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels May 7, 2024
@florian-h05 florian-h05 added this to the 4.2 milestone May 7, 2024
@florian-h05 florian-h05 merged commit 5f3d6da into openhab:main May 7, 2024
6 checks passed
@mherwege mherwege deleted the primary_ip_config branch May 7, 2024 11:56
@lolodomo
Copy link
Contributor

I just tested snapshot 4077 on a Windows PC. I do not see any step "Setup Primary Network" during the Setup wizard.

@lolodomo
Copy link
Contributor

Don't know if this is important but I passed/ignored the previous step (localisation).

@florian-h05
Copy link
Contributor

Skipping location doesn’t matter.
The primary network step only shows up when you have more that one interface so select from.

@lolodomo
Copy link
Contributor

The primary network step only shows up when you have more that one interface so select from.

Ok. On Windows, it looks like the WiFi interface does not linked to an IP address when the Ethernet interface is up, even if WiFi is enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants