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

Add network-interface context #3981

Merged
merged 1 commit into from Dec 31, 2023
Merged

Conversation

wborn
Copy link
Member

@wborn wborn commented Dec 29, 2023

This allows for selecting network interface names in configuration parameters.

Just add <context>network-interface</context> to your config parameter similar to <context>serial-port</context> .

This allows for selecting network interface names in configuration parameters.

Signed-off-by: Wouter Born <github@maindrain.net>
@mherwege
Copy link
Contributor

Could this also be used by the suggestion finders to limit the interfaces for scanning? Or by UPnP, mDNS. Or does use of the context limits it to use as binding parameters?
If it can be used elsewhere, where can it be configured?
Can it be configured in config files (other than for network binding things)?
I actually think this could be an overall parameter, just like the other network parameters.

@wborn
Copy link
Member Author

wborn commented Dec 30, 2023

Could this also be used by the suggestion finders to limit the interfaces for scanning? Or by UPnP, mDNS. Or does use of the context limits it to use as binding parameters?

You can use contexts with any config-description parameter, see Supported Contexts.

If it can be used elsewhere, where can it be configured?

Just add <context>network-interface</context> to your text parameter in the XML, e.g. in:

Can it be configured in config files (other than for network binding things)?

The values are just text so it should work. The context is used to define the available options. This can then be used by UIs to present configuration options and by the framework to validate values.

I actually think this could be an overall parameter, just like the other network parameters.

Maybe as a default value instead of always using every available interface which can be many when using Docker. But you can still have the situation where you want to use one network interface most of the time but still want to have the option to only use some network interfaces other times e.g. when using arping to see if a container is up.

Copy link
Member

@J-N-K J-N-K left a comment

Choose a reason for hiding this comment

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

LGTM

@J-N-K J-N-K added this to the 4.2 milestone Dec 31, 2023
@J-N-K J-N-K merged commit 7d1dcd7 into openhab:main Dec 31, 2023
3 checks passed
@wborn wborn deleted the network-interface-context branch December 31, 2023 22:46
wborn added a commit to wborn/openhab-docs that referenced this pull request Jan 2, 2024
This context was added in openhab/openhab-core#3981.

Signed-off-by: Wouter Born <github@maindrain.net>
stefan-hoehn pushed a commit to openhab/openhab-docs that referenced this pull request Jan 3, 2024
This context was added in openhab/openhab-core#3981.

Signed-off-by: Wouter Born <github@maindrain.net>
kaikreuzer pushed a commit that referenced this pull request Jan 5, 2024
This allows for selecting network interface names in configuration parameters.

Signed-off-by: Wouter Born <github@maindrain.net>
@kaikreuzer
Copy link
Member

Cherry-picked to 4.1.x.

@kaikreuzer kaikreuzer added the patch A PR that has been cherry-picked to a patch release branch label Jan 5, 2024
kaikreuzer pushed a commit to openhab/openhab-webui that referenced this pull request Jan 6, 2024
This allows for selecting multiple network interface names in
configuration parameters.

Related to:

* openhab/openhab-core#3981
* openhab/openhab-addons#16145

Signed-off-by: Wouter Born <github@maindrain.net>
kaikreuzer pushed a commit to openhab/openhab-webui that referenced this pull request Jan 6, 2024
This allows for selecting multiple network interface names in
configuration parameters.

Related to:

* openhab/openhab-core#3981
* openhab/openhab-addons#16145

Signed-off-by: Wouter Born <github@maindrain.net>
pgfeller pushed a commit to pgfeller/openhab-docs that referenced this pull request Jan 15, 2024
This context was added in openhab/openhab-core#3981.

Signed-off-by: Wouter Born <github@maindrain.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core patch A PR that has been cherry-picked to a patch release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants