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

Improve binding selection by filtering (including usage of binding metadata) #2050

Closed
jlaur opened this issue Sep 2, 2023 · 4 comments · Fixed by #2582
Closed

Improve binding selection by filtering (including usage of binding metadata) #2050

jlaur opened this issue Sep 2, 2023 · 4 comments · Fixed by #2582
Labels
enhancement New feature or request main ui Main UI

Comments

@jlaur
Copy link
Contributor

jlaur commented Sep 2, 2023

Seeing the nice results of #1997 I thought I'd finally suggest to use the new add-on metadata introduced in 4.0 to provide either filtering or additional search options.

I don't know if this is technically feasible, i.e. if the UI has access to these metadata when bindings are not yet installed. If not, please feel free to close this issue.

The problem

There is currently more than 350 bindings available which are shown in a long list per default:

image

It's possible to search by name, so it's not hard to find a specific binding.

Your suggestion

I'm not UI expert so I'm not sure exactly what would be the best suggestion here. But I will throw a few ideas anyway. 🙂

I'm wondering if the metadata connection and country could be taken into consideration. Per default we could exclude bindings having countries declared where none of those countries match the country configured in regional settings. So for example, when in Denmark:

image

I would not see any of these:

$ grep -R "<countries>" | grep -v "dk"
bundles/org.openhab.binding.dsmr/src/main/resources/OH-INF/addon/addon.xml:     <countries>nl,be,lu,at</countries>
bundles/org.openhab.binding.hccrubbishcollection/src/main/resources/OH-INF/addon/addon.xml:     <countries>nz</countries>
bundles/org.openhab.binding.kvv/src/main/resources/OH-INF/addon/addon.xml:      <countries>de</countries>
bundles/org.openhab.binding.linky/src/main/resources/OH-INF/addon/addon.xml:    <countries>fr</countries>
bundles/org.openhab.binding.meteoalerte/src/main/resources/OH-INF/addon/addon.xml:      <countries>fr</countries>
bundles/org.openhab.binding.nzwateralerts/src/main/resources/OH-INF/addon/addon.xml:    <countries>nz</countries>
bundles/org.openhab.binding.sncf/src/main/resources/OH-INF/addon/addon.xml:     <countries>fr</countries>
bundles/org.openhab.binding.vigicrues/src/main/resources/OH-INF/addon/addon.xml:        <countries>fr</countries>
bundles/org.openhab.binding.windcentrale/src/main/resources/OH-INF/addon/addon.xml:     <countries>nl</countries>
bundles/org.openhab.binding.ecowatt/src/main/resources/OH-INF/addon/addon.xml:  <countries>fr</countries>
bundles/org.openhab.binding.freeboxos/src/main/resources/OH-INF/addon/addon.xml:        <countries>fr,it</countries>

However, maybe there could be a checkbox to see all when the UI knows something has been excluded. Certainly it should be possible to install any binding (I'm not suggesting geo-restriction 🙂 at all), so there should be some simple way to bypass and see all.

Another small idea would be to allow filtering based on connection. I'm not sure how to consistently provide such an option in the UI, but I'm thinking if it could work the same way as GitHub issue/PR search (and to some extent Google) where you could add something like "connection:local" or "-connection:cloud" to exclude cloud. For example:

image

I realize this would be a quite hidden feature, so hopefully someone would have a better idea.

@jlaur jlaur added enhancement New feature or request main ui Main UI labels Sep 2, 2023
@florian-h05
Copy link
Contributor

Nice proposal, however unfortunately country and connection info are not available if the addon is not installed, see openhab/openhab-core#3795.

@jlaur
Copy link
Contributor Author

jlaur commented Nov 13, 2023

I have extracted one of the suggestions into #2170.

@jlaur
Copy link
Contributor Author

jlaur commented Dec 11, 2023

@florian-h05 - is it correct that with the new add-on suggestion feature, it would now be possible to search/filter by connection and country?

@florian-h05
Copy link
Contributor

I guess yes. I haven't looked into which data the API returns for installed add-ons yet ...

florian-h05 pushed a commit that referenced this issue May 31, 2024
Closes #2050.

This implements filtering for connection type and country (related to
region/country setting) in the addon store.

By default, it will filter for all connection types and filter out
addons not supported for a specific country if info on countries is
available.

---------

Signed-off-by: Mark Herwege <mark.herwege@telenet.be>
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 a pull request may close this issue.

2 participants