Return displayName(s) as string, not array

(DawgOnKing) #1

How do I return input.device.displayNames (for a sendPush) without the Array brackets?

def switchHandler(evt) {
def lightsOnLabels = houseLightsOn.displayName
def lightsOffLabels = houseLightsOff.displayName
log.debug "${lightsOnLabels}"
log.debug "${lightsOffLabels}"
def message = "Sleep Tight! The house is secure. I have turned on the ${lightsOnLabels} and turned off the ${lightsOffLabels}."


The above notification still includes an array of displayNames. I want a string.

(DawgOnKing) #2


houseLightsOn.displayName.join() - I didn’t that that was supported in groovy but it is.