Skip to content
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

Merged
merged 1 commit into from
Feb 27, 2021

Conversation

cweitkamp
Copy link
Contributor

@cweitkamp cweitkamp commented Jan 8, 2021

  • Added ActionService to support using Semantics features in Rules
  • Enhanced unit tests

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 Location
  • boolean isEquipment(Item) - checks if the given Item is is an Equipment
  • boolean isPoint(Item) - checks if the given Item is is a Point
  • Item getLocation(Item) - gets the Location Item of the Item
  • Class<? extends Location> getLocationType(Item) - gets the Location type of the Item
  • Item getEquipment(Item) - gets the Equipment Item an Item belongs to
  • Class<? extends Equipment> getEquipmentType(Item) - gets the Equipment type an Item belongs to
  • Class<? extends Point> getPointType(Item) - gets the Point type of an Item
  • Class<? extends Property> getPropertyType(Item) - gets the Property type an Item relates to
  • Class<? 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

@cweitkamp cweitkamp added the enhancement An enhancement or new feature of the Core label Jan 8, 2021
Base automatically changed from master to main January 18, 2021 20:04
@cweitkamp cweitkamp changed the title [semantics] Added ActionService to support using Sematics features in Rules [semantics] Added ActionService to support using Semantics features in Rules Jan 26, 2021
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
@cweitkamp cweitkamp marked this pull request as ready for review January 29, 2021 16:43
@cweitkamp cweitkamp requested a review from a team as a code owner January 29, 2021 16:43
Copy link
Member

@kaikreuzer kaikreuzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent addition, thanks!

@kaikreuzer kaikreuzer merged commit 191a629 into openhab:main Feb 27, 2021
@kaikreuzer kaikreuzer added this to the 3.1 milestone Feb 27, 2021
@kaikreuzer kaikreuzer changed the title [semantics] Added ActionService to support using Semantics features in Rules [semantics] Add ActionService to support using Semantics features in Rules Feb 27, 2021
@cweitkamp cweitkamp deleted the feature-semantics-in-rules branch February 27, 2021 11:40
@openhab-bot
Copy link
Collaborator

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

@openhab-bot
Copy link
Collaborator

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

@openhab-bot
Copy link
Collaborator

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

@openhab-bot
Copy link
Collaborator

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

splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this pull request Jul 11, 2023
Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
GitOrigin-RevId: 191a629
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement or new feature of the Core semantics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants