lot of changes for first actual use

This commit is contained in:
Wolfgang Hottgenroth
2017-08-23 15:52:37 +02:00
parent 16313c868f
commit 3797d84b4d
14 changed files with 250 additions and 81 deletions

26
dist/espthermtojson.js vendored Normal file
View File

@ -0,0 +1,26 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils = require("./utils");
class EspThermMessage {
constructor(client, temperature, voltage, timeConsumed) {
this._client = client;
this._temperature = temperature;
this._voltage = voltage;
this._timeConsumed = timeConsumed;
}
toString() {
return JSON.stringify(this);
}
toJSON() {
return utils.jsonPrepaper(this, []);
}
}
exports.EspThermMessage = EspThermMessage;
function espThermToJson(message) {
let messageStr = "" + message;
let parts = messageStr.split(' ');
let espThermMessage = new EspThermMessage(parts[0], parseFloat(parts[1]), parseFloat(parts[2]), parseInt(parts[3]));
return espThermMessage;
}
exports.espThermToJson = espThermToJson;
//# sourceMappingURL=espthermtojson.js.map