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

[DSL] Added implicit import for units to rule models #1376

Merged
merged 1 commit into from Feb 26, 2020

Conversation

cweitkamp
Copy link
Contributor

  • Added implicit import for units to rule models

Related to #917

This fix takes care of working rules without using imports of unit classes like #917 (comment). KILOMETRE_PER_HOUR now can be used with or without SIUnits prefix. The validation issue still is shown while rules are refreshed.

rule "Test SIUnits"
when
 	Item EnConges received command
then
	logInfo("Test.rules","Test SIUnits " + SIUnits.KILOMETRE_PER_HOUR.toString)
	val QuantityType<Speed> speed = new QuantityType(25.0, SIUnits.KILOMETRE_PER_HOUR)
 	logInfo("Test.rules", "Test SIUnits speed = " + speed.toString)
end

Signed-off-by: Christoph Weitkamp github@christophweitkamp.de

Signed-off-by: Christoph Weitkamp <github@christophweitkamp.de>
@cweitkamp cweitkamp added bug An unexpected problem or unintended behavior of the Core DSL rules Domain-Specific Language rules labels Feb 24, 2020
@kaikreuzer kaikreuzer merged commit 253f9ab into openhab:master Feb 26, 2020
@cweitkamp cweitkamp deleted the bugfix-917-namespace-scope branch February 26, 2020 20:05
@cweitkamp cweitkamp added this to the 3.0 milestone Apr 6, 2020
@cweitkamp cweitkamp added the UoM Units of Measurement label Apr 6, 2020
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: 253f9ab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core DSL rules Domain-Specific Language rules UoM Units of Measurement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants