openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

[automation] Add more basic time-related classes for usage in script and rules

Open cweitkamp opened this issue 3 years ago • 1 comments

  • Add more basic time-related classes for usage in script and rules

Allows comparisons like new DateTimeType().zonedDateTime.getDayOfWeek() = DayOfWeek.MONDAY or new DateTimeType().zonedDateTime.getMonth() = Month.APRIL in rules or scripts.

Signed-off-by: Christoph Weitkamp [email protected]

cweitkamp avatar Oct 13 '22 11:10 cweitkamp

This is surely a nice addition for DSL rules, but could it be we shadow language specific symbols when importing this in the default script scope for JSR223 scripts?

J-N-K avatar Oct 13 '22 16:10 J-N-K

That is a good point. And I somehow agree. For JSR223 scripting it is just a convenient way for users to use the Java classes in there scripts while omitting to import them.

cweitkamp avatar Oct 14 '22 05:10 cweitkamp