2020-06-29 07:16:16 -07:00
|
|
|
const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
|
|
|
|
const settings = require('../util/settings');
|
|
|
|
const Extension = require('./extension');
|
2020-07-03 12:20:22 -07:00
|
|
|
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);
|
|
|
|
|
2020-07-03 12:20:22 -07:00
|
|
|
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;
|