ptvoinfo / zigbee-configurable-firmware

PTVO firmware for CC2530, CC2531, and CC2652 Zigbee chips
https://ptvo.info/zigbee-configurable-firmware-features/
MIT License
210 stars 22 forks source link

Please explain meta, endpoint and configure #308

Closed daestx closed 2 months ago

daestx commented 2 months ago

When creating a converter.js file from PTVO tool, it contains following code:

meta: {
    multiEndpoint: true,

},
endpoint: (device) => {
    return {
        l1: 1, action: 1, l2: 2,
    };
},
configure: async (device, coordinatorEndpoint, logger) => {
  const endpoint = device.getEndpoint(1);
  await endpoint.read('genBasic', ['modelId', 'swBuildId', 'powerSource']);
},

For me it is currently not clear what it is used for. Is this section needed when sending data via Zigbee to the device? Currently my device is just sending data. I stripped this section from my code and I see no difference.

Please explain

ncolomer commented 2 months ago

Hello @daestx,

Reading from the many examples you can find in the many converter examples here + self deduction and testing:

Need to admit I asked myself all same questions. It's a pain this lib is not documented... but at least you have many examples to learn from + access to the codebase.

Also note your issue would probably better sit in Koenkk/zigbee-herdsman-converters repo rather than this one. I think PTVO provides converter(s) as a courtesy only for their users.