There are ways to deal with this sort of thing:
- Use Designer to catch syntax errors for you
- Use persistence with restoreOnStartup to avoid the NULLs
- Make use of the ? operator for a quick test for null
if(timers.get("foo") != null) timers.get("foo").cancel
can be replaced with
timers.get("foo")?.cancel
- Make use of Groups
- be aware that OH 2 is a lot better at handling casts for your so you rarely need to do something like
if(MyItem.state as DecimalType > 20)
any longer.
With the above I find I have no more tests than I do in any other not strongly typed language such as Python or JavaScript.