Skip to content

Commit

Permalink
fixing warning if data is not yet available in influx
Browse files Browse the repository at this point in the history
  • Loading branch information
orangecoding committed Mar 9, 2021
1 parent 4f5c1b9 commit a2688fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-influx",
"version": "0.0.3",
"version": "0.0.4",
"description": "A Homebridge plugin that exposes latest values from an InfluxDB instance.",
"license": "MIT",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const defaultConfig = {
const getLastMeasurement = (influx, service, schema, cb) => {
influx
.query(`SELECT LAST("${schema[service].field}") FROM ${schema[service].measurement}`)
.then(result => cb(null, result[0].last))
.then(result => cb(null, result[0] == null ? -1 : result[0].last))
.catch(err => cb(err));
};

Expand Down

0 comments on commit a2688fb

Please sign in to comment.