message: [fix] Rgb light dimmer discovery
diff: @@ -382,7 +382,6 @@ Gateway.prototype.parsePayload = function (payload, valueId, valueConf) {
  // Hass payload parsing
  if (this.discovered[valueId.value_id]) {
  -
  // parse payload for switchs
  if ((valueId.type === 'bool' || this.discovered.object_id === 'rgb_dimmer') && typeof payload === 'string') {
  if (/\btrue\b|\bon\b/gi.test(payload)) payload = valueId.type === 'bool' ? true : valueId.max || 100
  @@ -663,7 +662,7 @@ Gateway.prototype.discoverValue = function (node, valueId) {
  case 'switch_binary':
  case 'switch_all':
  case 'switch_toggle_binary':
  - let rgb = node.values.find(v => v.class_id === 0x33 && v.index === 0)
  + let rgb = node.values['51-1-0']
  if (rgb) {
  cfg = copy(hassCfg.light_rgb_switch)
  cfg.discovery_payload.rgb_state_topic = this.mqtt.getTopic(this.valueTopic(node, rgb, true))
  @@ -680,13 +679,13 @@ Gateway.prototype.discoverValue = function (node, valueId) {
  // cfg.discovery_payload.position_topic = this.mqtt.getTopic(topic)
  // cfg.discovery_payload.set_position_topic = cfg.discovery_payload.position_topic + '/set'
  if (valueId.index === 0) { // brightness level
  - let rgb = node.values.find(v => v.class_id === 0x33 && v.index === 0)
  + let rgb = node.values['51-1-0']
  if (rgb) {
  cfg = copy(hassCfg.light_rgb_dimmer)
  cfg.discovery_payload.rgb_state_topic = this.mqtt.getTopic(this.valueTopic(node, rgb, true))
  cfg.discovery_payload.rgb_command_topic = cfg.discovery_payload.rgb_state_topic + '/set'
  - cfg.brightness_state_topic = this.mqtt.getTopic(topic)
  - cfg.brightness_command_topic = cfg.brightness_state_topic + '/set'
  + cfg.discovery_payload.brightness_state_topic = this.mqtt.getTopic(topic)
  + cfg.discovery_payload.brightness_command_topic = cfg.brightness_state_topic + '/set'
  } else {
  cfg = copy(hassCfg.light_dimmer)
  }
  @@ -828,13 +827,13 @@ Gateway.prototype.discoverValue = function (node, valueId) {
  if (valueConf.icon) cfg.discovery_payload.icon = valueConf.icon
  }
  break
  - case 'color':
  - if (valueId.index === 0) {
  - cfg = copy(hassCfg.light_rgb)
  - cfg.discovery_payload.rgb_state_topic = this.mqtt.getTopic(topic)
  - cfg.discovery_payload.rgb_command_topic = cfg.discovery_payload.rgb_state_topic + '/set'
  - } else return
  - break
  + // case 'color':
  + // if (valueId.index === 0) {
  + // cfg = copy(hassCfg.light_rgb)
  + // cfg.discovery_payload.rgb_state_topic = this.mqtt.getTopic(topic)
  + // cfg.discovery_payload.rgb_command_topic = cfg.discovery_payload.rgb_state_topic + '/set'
  + // } else return
  + // break
  case 'battery':
  cfg = copy(hassCfg.sensor_battery)
  break
  