How to use the zigbee2mqtt/node_modules/zigbee-herdsman-converters.devices.length function in zigbee2mqtt

To help you get started, we’ve selected a few zigbee2mqtt examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Koenkk / zigbee2mqtt.io / docgen / supported-devices.js View on Github external
display: table !important;
}
.main-content table tr th:nth-child(1) {
  width: 15%;
}
.main-content table tr th:nth-child(2) {
  width: 60%;
}
.main-content table tr th:nth-child(3) {
  width: 25%;
}


*NOTE: This file has been generated, do not edit this file manually!*

Currently **${devices.length}** devices are supported from **${vendorsCount}** different vendors.

In case you own a Zigbee device which is **NOT** listed here, please see
[How to support new devices](../how_tos/how_to_support_new_devices.md).

[DEVICES]
`;

const generateTable = (devices) => {
    let text = '';
    text += '| Model | Description | Picture |\n';
    text += '| ------------- | ------------- | -------------------------- |\n';
    devices = new Map(devices.map((d) => [d.model, d]));
    devices.forEach((d) => {
        const image = utils.getImage(d.model);
        // eslint-disable-next-line
        text += `| [${d.model}](../devices/${utils.normalizeModel(d.model)}.md) | ${d.vendor} ${d.description} (${d.supports}) | ![${image}](${image}) |\n`;