VNODE-AUTOMATION - Vnode

Sensor

Codec Description

Codec for VNODE-AUTOMATION - Vnode (v1.0.0).

Codec Preview

function parseExtended(raw_payload) { const variables = []; for (const item of raw_payload) { const my_var = item.t.replace('/', '').split('/').join('_'); variables.push({ variable: my_var, value: item.v, time: item.ts }) } return variables; } function parseCompact(raw_payload) { const variables = []; for (key in raw_payload) { const my_var = key.replace('/', '').split('/').join('_'); for (const item of raw_payload[key]) { variables.push({ variable: my_var, value: item.v, time: item.ts }) } } return variables; } if (Array.isArray(payload[0])) { payload = parseExtended(payload[0]); } else if (!payload[0].variable) { payload = parseCompact(payload[0]); }

This codec is sourced from TagoIO Github. All rights belong to TagoIO Github.

This codec is licensed under the GNU General Public License v3 (GPL v3). Modifications, if any, are clearly marked. You are free to use, modify, and distribute the codec under the terms of GPL v3.

Community Feedback