remove leading underscore, fix next call in mongosave
This commit is contained in:
33
dist/espthermtojson.js
vendored
33
dist/espthermtojson.js
vendored
@ -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);
|
||||
|
Reference in New Issue
Block a user