-
-
Notifications
You must be signed in to change notification settings - Fork 450
Semantic Tags: set EQUIPMENT tags on Things #4617
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
Conversation
Signed-off-by: Andrew Fiddian-Green <[email protected]>
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-5-semantic-model-proposal/162526/96 |
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
@mherwege can I kindly ask you to be a sparring partner for this PR? My goal is to allow developers to set a (proposed) semantic (equipment) tag in their thing type xml, and have this permeated through the thing type instances to the actual thing instances so that the UI can use that semantic (equipment) tag (as a hint) in creating a semantic model. |
@andrewfg Sure. I like the idea as long as it does not then enforce anything on the item semantics. So I would think that it should be carried to the point of a having a tag on the thing, but then it should be up to the UI to pick this up as a suggested equipment semantic when creating the group item with its points (create model from thing). |
Indeed. The tags in the ChannelType xml are hints for semantic “point” and semantic “property” tags which are intended for functional Item creation. And the single tag in the ThingType xml would be a hint for the semantic “equipment” tag intended for semantic GroupItem creation. The remaining “location” semantic tag is entirely user dependent and would not come from the xml. PS we could even explicitly name it |
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
...rg.openhab.core.thing/src/main/java/org/openhab/core/thing/binding/builder/ThingBuilder.java
Outdated
Show resolved
Hide resolved
...config.discovery/src/main/java/org/openhab/core/config/discovery/DiscoveryResultBuilder.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
bundles/org.openhab.core.thing/schema/thing/thing-description-1.0.0.xsd
Outdated
Show resolved
Hide resolved
Signed-off-by: Andrew Fiddian-Green <[email protected]>
I don't think this is a very complex change in the UI. I can take care of it, but would prefer to finish the core code first. There are a lot of moving parts and dependencies here, and creating a core that has it all for testing a UI change against is a bit of a challenge. It will be easier to do when we get the core changes over the line first. |
@mherwege understood. IMHO all the changes in OH Core are ready to merge (via this PR). So it would be helpful if you can review this and give LGTM so that we can indeed proceed to merge it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ping @ccutrer apropos our discussion on Equipment tags |
@andrewfg May I ask you to rebase this PR? |
Signed-off-by: Andrew Fiddian-Green <[email protected]>
Signed-off-by: Andrew Fiddian-Green <[email protected]>
@kaikreuzer done! Apparently the CI / JavaDoc test failed but I don't know why. |
@andrewfg the log of the javadoc job needs improvement. Running it locally, I see the message causing it to fail:
|
bundles/org.openhab.core.thing/src/main/java/org/openhab/core/thing/Thing.java
Outdated
Show resolved
Hide resolved
…thing/Thing.java Co-authored-by: Holger Friedrich <[email protected]> Signed-off-by: Andrew Fiddian-Green <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Refs openhab/openhab-core#4617. If the thing provides a default `semanticEquipmentTag`, this will be used when creating an equipment from thing instead of the default `Equipment`. Signed-off-by: Mark Herwege <[email protected]>
Addon developers may (or may not) set POINT/PROPERTY semantic tags in their addons. These tags are set either a) in the
channel-type.xml
of the addon, or b) dynamically at run-time via the addon Java code. The purpose of POINT/PROPERTY tags is for Main UI to offer appropriate tags on Items so that they will properly fit in the the user's hierarchical semantic model. Thus eliminating complexity for users.Main UI also allows the user to apply EQUIPMENT tags when creating the user's hierarchical semantic model. However currently the user has to decide on, and apply, the EQUIPMENT tags manually themselves when setting up their system.
The purpose of this PR is to add a semantic EQUIPMENT tag to Things. This allows developers to set the EQUIPMENT tag on a Thing either a) in the
thing-type.xml
of the addon, or b) dynamically at run-time via the addon Java code. So that addons can offer the most appropriate EQUIPMENT tag via the Main UI. Thus further eliminating complexity for users.This PR does the following:
See also #4615
Resolves #4614
Used by openhab/openhab-webui#3124
Signed-off-by: Andrew Fiddian-Green [email protected]