-
-
Notifications
You must be signed in to change notification settings - Fork 429
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
[semantics] Add ActionService to support using Semantics features in Rules #2088
Conversation
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
c05ae47
to
92ca7ac
Compare
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.
Excellent addition, thanks!
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/openhab-3-1-milestone-discussion/116025/25 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/access-oh3-semantic-metadata-by-dsl-rules/118903/4 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/how-to-use-new-actionservice-for-semantics-in-rules/125844/1 |
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/extending-blockly-with-new-openhab-commands/127169/409 |
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de> GitOrigin-RevId: 191a629
I like to use Semantic features in Rules. E.g. determine the location of an item. Regardless if it is a Point, an Equipment or a Location itself. Therefore I propose to add a bunch methods to be used in Rules. I submitted this as a draft because I am not sure if this is the preferred way to add such features.
boolean isLocation(Item)
- checks if the given Item is is a Locationboolean isEquipment(Item)
- checks if the given Item is is an Equipmentboolean isPoint(Item)
- checks if the given Item is is a PointItem getLocation(Item)
- gets the Location Item of the ItemClass<? extends Location> getLocationType(Item)
- gets the Location type of the ItemItem getEquipment(Item)
- gets the Equipment Item an Item belongs toClass<? extends Equipment> getEquipmentType(Item)
- gets the Equipment type an Item belongs toClass<? extends Point> getPointType(Item)
- gets the Point type of an ItemClass<? extends Property> getPropertyType(Item)
- gets the Property type an Item relates toClass<? extends Tag> getSemanticType(Item)
- gets the semantic type of an Item (i.e. a sub-type of Location, Equipment or Point)Signed-off-by: Christoph Weitkamp github@christophweitkamp.de