message: Make the mapping of HVAC modes optional, since not all thermostats support modes and home assistant docs define modes as optional
diff: @@ -588,15 +588,21 @@ Gateway.prototype.discoverDevice = function (node, hassDevice) {
  var mode = node.values[payload.mode_state_topic]
  var currTemp = node.values[payload.current_temperature_topic]
  - var setId = hassDevice.setpoint_topic && hassDevice.setpoint_topic[mode.value] ? hassDevice.setpoint_topic[mode.value] : hassDevice.default_setpoint
  + var setId;
  + if(mode !== undefined) {
  + setId = hassDevice.setpoint_topic && hassDevice.setpoint_topic[mode.value] ? hassDevice.setpoint_topic[mode.value] : hassDevice.default_setpoint
  + }
  + else {
  + setId = hassDevice.default_setpoint;
  + }
  var setpoint = node.values[setId]
  -
  var map = getMappedValues(mode, hassDevice.mode_map, this.config.integerList)
  + if(mode !== undefined) {
  payload.mode_state_template = `{% set values = ${JSON.stringify(map.map)} %} {{ ${map.check} }}`
  -
  payload.mode_state_topic = this.mqtt.getTopic(this.valueTopic(node, mode))
  payload.mode_command_topic = payload.mode_state_topic + '/set'
  + }
  payload.current_temperature_topic = this.mqtt.getTopic(this.valueTopic(node, currTemp))
  payload.temperature_state_topic = this.mqtt.getTopic(this.valueTopic(node, setpoint))
  payload.temperature_command_topic = payload.temperature_state_topic + '/set'
  