Yes, everything in DSL in the “global” context (actually only global within this rules file) cannot “see” other global objects… So when you call function X from a rule, and it needs to use function Y, you must pass a reference to that in the call.
Oh thanks for that explanation. That also means I can move that as a local val in the main function. Maybe not worth it for these two lines of code, but good to know.
If you want to use exotic (for home automation) programming techniques, that might not suit.
While the code may be exotic in a way, the notion itself (multiple taps) is trivial and definitely something that is common on switches. It’s natural to want to be able to use that on controls where it’s not native.
Jython rules are flavour of the month, likely to be the standard for OH3, but you don’t like that and it doesn’t yet appear to be set in concrete anyway.
Well I just wish my brain didn’t have to think about Python 2.7 vs Python 3 when writing any Python . But that wouldn’t be the end of the world. It’s not like I breathe Python anyways.