message: fix(hass): metertype discovery
diff: -const { lookupMeterScale } = require('@zwave-js/config')
  +const { lookupMeterScale, lookupMeter } = require('@zwave-js/config')
  module.exports = {
  // https://github.com/OpenZWave/open-zwave/blob/0d94c9427bbd19e47457578bccc60b16c6679b49/config/Localization.xml#L606
  @@ -17,24 +17,45 @@ module.exports = {
  }
  }
  },
  - // https://github.com/OpenZWave/open-zwave/blob/0d94c9427bbd19e47457578bccc60b16c6679b49/config/Localization.xml#L679
  - // https://github.com/OpenZWave/open-zwave/blob/0d94c9427bbd19e47457578bccc60b16c6679b49/cpp/src/command_classes/Meter.cpp#L74
  meterType (ccSpecific) {
  - let cfg = null
  - if (ccSpecific.meterType >= 16 && ccSpecific.meterType < 32) {
  - // gas
  - cfg = this.sensorType(55)
  - } else if (ccSpecific.meterType >= 32 && ccSpecific.meterType < 48) {
  - // water
  - cfg = this.sensorType(12)
  - } else {
  - // electricity
  - cfg = this.sensorType(4)
  + const meter = lookupMeter(ccSpecific.meterType)
  + const scale = lookupMeterScale(ccSpecific.meterType, ccSpecific.scale)
  +
  + const cfg = {
  + sensor: (meter ? meter.name : 'unknown') + ccSpecific.meterType,
  + objectId: (scale ? scale.label : 'unknown' + ccSpecific.scale) + '_meter',
  + props: {}
  }
  - const scale = lookupMeterScale(ccSpecific.meterType, ccSpecific.scale)
  + // https://github.com/zwave-js/node-zwave-js/blob/master/packages/config/config/meters.json
  + switch (ccSpecific.meterType) {
  + case 0x01: // electric
  + cfg.props = {
  + device_class: 'power'
  + }
  + break
  + case 0x02: // gas
  + cfg.props = {
  + icon: 'mdi:thought-bubble'
  + }
  + break
  + case 0x03: // water
  + cfg.props = {
  + icon: 'mdi:water'
  + }
  + break
  + case 0x04: // heating
  + cfg.props = {
  + icon: 'mdi:fire'
  + }
  + break
  + case 0x05: // cooling
  + cfg.props = {
  + icon: 'mdi:snowflake'
  + }
  + break
  + }
  - cfg.objectId = (scale ? scale.label : 'unknown') + '_meter'
  return cfg
  },
  // https://github.com/OpenZWave/open-zwave/blob/4478eea26b0e1a29184df0515a8034757258ff88/cpp/src/ValueIDIndexesDefines.def#L1068
  