JRuby OpenHAB Rules System

Ah, there you are! That makes sense. With this I can split the rule files again and it works nicely.

Another noobie-question:
Is timers.cancel(someItem) if timers.include?(someItem) necessary or can it be reduced to timers.cancel(someItem) in a typical use case? Typical means: Usually I am not interested in whether the timer could be canceled or not. I assume it will get canceled if there exists one for the item.

Correct - you don’t have to check if it exists before canceling. And it will return true if it canceled; false otherwise. https://openhab.github.io/openhab-jruby/main/OpenHAB/DSL/TimerManager.html#cancel-instance_method

Alright then. I think I‘m done with the refactoring from RuleDSL to JRuby. :star_struck:

I will make some cosmetic changes here and there and will post examples afterwards in the examples section of this forum to show how I solved certain use cases to ultimately inspire more people to use this wonderful scripting language.

Thank you all for the great support!

3 Likes