mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-15 18:08:32 -07:00
12 lines
435 B
JavaScript
12 lines
435 B
JavaScript
const fs = require('fs');
|
|
const filename = process.argv[2];
|
|
const text = fs.readFileSync(filename, 'utf8');
|
|
const zigbeeHerdsmanConverters = require('zigbee-herdsman-converters');
|
|
|
|
|
|
for (const line of text.split('\n')) {
|
|
const model = zigbeeHerdsmanConverters.devices.find((d) => d.model === line);
|
|
if (!model) throw new Error(`${line} does not exist`);
|
|
console.log(`- \`${line}\` ${model.vendor} ${model.description}`);
|
|
}
|