Skip to content

Commit

Permalink
build: 1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonJuhan committed Aug 5, 2021
1 parent 0a9762e commit 41fffb9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
24 changes: 19 additions & 5 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var ESP8266DHT = /*#__PURE__*/function () {
temperature: 26,
humidity: 50
};
this.getSensorData();
this.temperatureService = new this.Service.TemperatureSensor(this.name);
this.temperatureService.getCharacteristic(this.Characteristic.CurrentTemperature).onGet(this.handleCurrentTemperatureGet.bind(this));
this.humidityService = new this.Service.HumiditySensor(this.name);
Expand Down Expand Up @@ -118,11 +119,24 @@ var ESP8266DHT = /*#__PURE__*/function () {
var callGoogleAppsScript = function callGoogleAppsScript() {
(0, _gas.callAppsScript)(params.scriptId, params.functionName, _this.sensorData, function (bool, res) {
if (bool) {
setTimeout(function () {
_this.getSensorData();

callGoogleAppsScript();
}, 300000);
setTimeout( /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
return _regenerator["default"].wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return _this.getSensorData();

case 2:
callGoogleAppsScript();

case 3:
case "end":
return _context2.stop();
}
}
}, _callee2);
})), 600000);
} else {
console.log('Call Google Apps Script Error');
console.log(res);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-esp8266-dht-sensor",
"version": "1.0.1",
"version": "1.0.2",
"description": "Allows homebridge to get ESP8266 DHT22 Sensor",
"main": "./build/index.js",
"scripts": {
Expand Down

0 comments on commit 41fffb9

Please sign in to comment.