zigbee2mqtt/lib/extension/externalConverters.js

19 lines
674 B
JavaScript
Raw Normal View History

2020-06-29 07:16:16 -07:00
const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
const settings = require('../util/settings');
const Extension = require('./extension');
const utils = require('../util/utils');
2020-06-29 07:16:16 -07:00
class ExternalConverters extends Extension {
constructor(zigbee, mqtt, state, publishEntityState, eventBus) {
super(zigbee, mqtt, state, publishEntityState, eventBus);
for (const definition of utils.getExternalConvertersDefinitions(settings)) {
const toAdd = {...definition};
delete toAdd['homeassistant'];
zigbeeHerdsmanConverters.addDeviceDefinition(toAdd);
}
2020-06-29 07:16:16 -07:00
}
}
module.exports = ExternalConverters;