remove leading underscore, fix next call in mongosave

This commit is contained in:
Wolfgang Hottgenroth
2017-08-24 15:51:34 +02:00
parent a0a922f851
commit 25116aae89
14 changed files with 230 additions and 170 deletions

View File

@ -1,12 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils = require("./utils");
class EspThermData {
constructor(temperature, voltage, timeConsumed) {
this.temperature = temperature;
this.voltage = voltage;
this.timeConsumed = timeConsumed;
}
toString() {
return JSON.stringify(this);
}
toJSON() {
return utils.jsonPrepaper(this, []);
}
}
exports.EspThermData = EspThermData;
class EspThermMetadata {
constructor(client, timestamp) {
this.client = client;
this.timestamp = (timestamp) ? timestamp : new Date();
}
toString() {
return JSON.stringify(this);
}
toJSON() {
return utils.jsonPrepaper(this, []);
}
}
exports.EspThermMetadata = EspThermMetadata;
class EspThermMessage {
constructor(client, temperature, voltage, timeConsumed) {
this._client = client;
this._temperature = temperature;
this._voltage = voltage;
this._timeConsumed = timeConsumed;
this.data = new EspThermData(temperature, voltage, timeConsumed);
this.metadata = new EspThermMetadata(client);
}
toString() {
return JSON.stringify(this);