message: fix: ensure temperature and mode are defined
diff: @@ -1160,6 +1160,7 @@ Gateway.prototype.discoverClimates = function (node) {
  return
  }
  + try {
  const nodeDevices = allDevices[node.deviceId] || []
  // skip if there is already a climate device
  @@ -1194,6 +1195,13 @@ Gateway.prototype.discoverClimates = function (node) {
  const mode = modes[0]
  const temperature = temperatures[0]
  + if (!temperature || !mode) {
  + debug(
  + 'Unable to discover climate device, there is no valid temperature/thermostat mode valueIds'
  + )
  + return
  + }
  +
  // [0, 1, 2] ---> ['off', 'heat', 'cold']
  const availableModes = mode.states.map(s => s.value)
  @@ -1252,6 +1260,9 @@ Gateway.prototype.discoverClimates = function (node) {
  debug('New climate device discovered: ' + JSON.stringify(config))
  allDevices[node.deviceId] = nodeDevices
  + } catch (error) {
  + debug('Unable to discover climate device: ' + error.message)
  + }
  }
  /**
  