UNPKG

node-enocean-ts

Version:

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

23 lines 705 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = default_1; function default_1(eep, data) { var ret = null; if (eep === "a5-30-01") { var bat = parseInt(data.substring(2, 4), 16); var con = parseInt(data.substring(4, 6), 16); var contact = (con >= 196) ? "open" : "closed"; var battery = (bat >= 121) ? "OK" : "LOW"; return [{ type: "contact", unit: "", value: contact }, { type: "battery_status", unit: "", value: battery }]; } return ret; } //# sourceMappingURL=eep-a5-30-01.js.map