node-enocean-ts
Version:
Typescript full implementation of the enocean protocol (ESP3 + EEP2.6)
27 lines • 935 B
JavaScript
;
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 eepa = eep.split("-");
var choice = eepa[0];
var func = eepa[1];
var type = eepa[2];
var typeNr = parseInt(type, 16);
if (choice === "a5" && func === "02" && sensors[type] !== undefined) {
return [{
type: "temperature",
unit: "°C",
value: eepHelper_1.default.extract10BitValue(1, 1023, 0, sensors[type].min, sensors[type].max, data)
}];
}
return null;
}
var sensors = {
20: { min: -10, max: 41.2 }, //10
30: { min: -40, max: 62.3 }, //20
};
//# sourceMappingURL=eep-a5-02-10bit.js.map