Adding ItemChannelLinkRegistry to DefaultScriptScopeProvider

I wonder, is there any reason not to add ItemChannelLinkRegistry to DefaultScriptScopeProvider? I’ve seen some questions in this community about how to get a thing linked to an item. Would a PR that adds ItemChannelLinkRegistry to DefaultScriptScopeProvider be welcome?

As for my particular case, in a UI Rule action script I’ve tried to get the thing’s label given an updated item that triggered the rule. I’ve got org.openhab.core.thing.link.ItemChannelLinkRegistry via org.osgi.framework.FrameworkUtil and now my script works as intended. While it works, it feels like a workaround to me.

I don’t see a reason to not add it, I rather think it hasn’t been added because no one thought of it.

So feel free to create a PR to add it :+1:

Done:

https://github.com/openhab/openhab-core/pull/4937

https://github.com/openhab/openhab-docs/pull/2532

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.