0

This is for a Samsung SmartThings smart app. I've never used Groovy outside of this context, so I'm not sure if this is a quirk of SmartThings or Groovy. It seems that the following should work, but I keep getting a runtime error:

def initialize() {
    state.ALL_MODES = ['standby', 'home', 'away']
    state.ALL_MODES_STR = state.All_MODES.join(", ")
}

I get the following error in the SmartThings IDE simulator:

java.lang.NullPointerException: Cannot invoke method join() on null object 

I am able to output state.ALL_MODES just fine, but when I attempt to join() it, I get this error. What am I missing here?

Matt
  • 273
  • 1
  • 2
  • 10

0 Answers0