UNPKG

node-enocean-ts

Version:

Typescript full implementation of the enocean protocol (ESP3 + EEP2.6)

33 lines 1.1 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = default_1; const eepHelper_1 = __importDefault(require("./eepHelper")); function default_1(eep, data) { var ret = null; var eepa = eep.split("-"); var choice = eepa[0]; var func = eepa[1]; var type = eepa[2]; var typeNr = parseInt(type, 16); if (eep === "a5-06-03") { val1 = eepHelper_1.default.extract10BitValueReverse(2, 0, 1000, 0, 1000, data); val2 = eepHelper_1.default.extractByteValue(3, 0, 250, 0, 5, data); var select = eepHelper_1.default.extractBitValue(0, 0, 1, data); ret = [{ type: "illumination", unit: "lux", value: val1 }, { type: "voltage", unit: "V", value: val2 }]; return ret; } return ret; } //# sourceMappingURL=eep-a5-06-03.js.map