-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Importing rules, items, and actions fail #15
Comments
Since I'm not doing anything that involves the ItemBuilderFactory nor the ManagedItemProvider I commented that part of the code out and it seems to work well enough to get past this hurdle temporarily. |
I have seen this on a fresh OH install, but not my production one which is very strange. I'll take a look at it again. |
This is also from a snapshot download, not sure what has changed. |
Not to add to the woes but I'm also see the following when trying to access a Metadata value through the library.
|
well, i think i found probably what's causing this to fail in JS On my production machine running Object.keys(require('@runtime/osgi')).forEach(k => {
console.log("@runtime Key:", k);
}) produces:
On a more recent milestone release, it outputs nothing. So something has changes with these globals. |
Ok, well looks like i had installed https://github.com/jpg0/ohj-support some time ago and forgot about it, so this was providing the missing bits. Let me see if we can do without is or if some of that needs to go into the JSScripting binding |
@jpg0 looks like i had your ohj-support library installed and forgot about it, it looks like this may be required. Do you see a way around this? or should we combine this code into the JSScripting binding ? |
So i added in most of the classes untouched from https://github.com/jpg0/ohj-support into the binding and everything works again. @jpg0 these seem to be reasonable additions , so i don't have any problems adding them if you are ok? (i removed the sitemap support as well as the suspendible rule support as i did not see them used) |
I have no problem with them being included. Note that they are all fairly generic things though, so should probably be moved to the core scripting bundle rather than a language-specific one. I originally had them in the JS bundle for expediency, then moved them out to ohj-support so that the JS bundle remained as clean as possible for acceptance into openhab-addons. |
Sounds good, It looks like only the OSGiScriptExtensionProvider class and supporting classes for it are required? I think everything else is being provided by openHAB core? Does this sound right ? |
Providing this in core would also solve openhab/openhab-core#2173 as well, yes? |
This appears to have been fixed in the latest version of the add-on (openhab/openhab-core#2433 (comment)). I'll close it but if I'm wrong and it covers other stuff not yet fixed please feel free to reopen it. |
I'm running the snapshot of OH from Monday and I've installed the helper library using npm following the instructions in the readme. I've included at the top of my script per the readme
I'm pretty sure I don't have the changes yet that injects that for me.
I get the following error when
rules
anditems
are included in that list.I get the following error when I include
actions
in that list:If I were to put a priority on these I'd put it on
items
since that will probably be the most used part of the library.For
rules
anditems
it appears to be failing on line 11 in managed.js which is trying to get a reference to"org.openhab.core.items.ItemBuilderFactory"
using OSGI. I don't see anything wrong with the code and can't imagine I have done something that might have broken this so am at a loss for how to proceed.The text was updated successfully, but these errors were encountered: