crazyivan359 / openhab-helper-libraries Goto Github PK
View Code? Open in Web Editor NEWThis project forked from openhab-scripters/openhab-helper-libraries
JSR223-Jython scripts and modules for use with openHAB
License: Eclipse Public License 1.0
This project forked from openhab-scripters/openhab-helper-libraries
JSR223-Jython scripts and modules for use with openHAB
License: Eclipse Public License 1.0
Is your feature request related to a problem? Please describe.
OH3 exposes a new action called "Semantics" to access attributes of the new OH3 semantic model, e.g. locations, equipments, points... I tried to use that action in Jython but it failed out of the box (see below).
Describe the solution you'd like
It would be great to use Sematics action like other actions:
from core.actions import Semantics
...
locationItem = Semantics.getLocation(pointItem)
Describe alternatives you've considered
I tried to import the action directly, but failed:
from org.openhab.core.model.script.actions import Semantics
Error during evaluation of script 'file:/etc/openhab/automation/jsr223/python/personal/tests.py': ImportError: cannot import name Semantics
Additional context
Do you know what steps are required to use that new action? Is it required to extend automation/lib/python/core/actions.py
?
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
@when("Member of gMyGroup received update")
.gMyGroup
.Expected behavior
All members of the group are part of the rule triggers.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
As posted in openHAB's community forum, I would like an option to replace the random auto-generated rule IDs with custom IDs defined by the user.
According to @CrazyIvan359 that should be possible (forum):
To anyone interested in adding this: there is a UUID validation function in utils.py already. You would need to add a parameter to the rule function and run that through the validator, accounting of course for it not being supplied or an invalid value being supplied.
I can add this but I donβt know when I will have time right now, but if someone submits a PR tested on OH2 and OH3 then I can pop over and approve it.
I just got started with Python in general and Jython rules in the specific - so it might take some time until I feel comfortable enough with the Helper-Libraries to contribute. But I'm not saying no π
But I would also not be sad if someone else solves that issue in the meantime π
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.