The corrected code looks like this:
setSupportedThermostatModes(JsonOutput.toJson(["auto", "cool", "emergency heat", "heat", "off"]))
def setSupportedThermostatModes(modes) {
sendEvent(name: "supportedThermostatModes", value: modes)
}
The corrected code looks like this:
setSupportedThermostatModes(JsonOutput.toJson(["auto", "cool", "emergency heat", "heat", "off"]))
def setSupportedThermostatModes(modes) {
sendEvent(name: "supportedThermostatModes", value: modes)
}