homebridge-syntex-webhooks
Advanced tools
Comparing version 1.0.5-b18 to 1.0.5-b19
82
index.js
@@ -105,27 +105,2 @@ var request = require('request'); | ||
var pathname = this.cacheDirectory + 'storage.json'; | ||
fs.exists(pathname, function (exist) | ||
{ | ||
if(!exist) | ||
{ | ||
log('\x1b[31m%s\x1b[0m', "[ERROR]", pathname + ' wurde nicht gefunden!'); | ||
} | ||
else | ||
{ | ||
fs.readFile(pathname, function(err, data) | ||
{ | ||
if(err) | ||
{ | ||
log('\x1b[31m%s\x1b[0m', "[ERROR]", 'Die Seite konnte nicht geladen werden: ' + err); | ||
} | ||
else | ||
{ | ||
log('\x1b[32m%s\x1b[0m', "[SUCCESS]", pathname); | ||
log(data.toString()); | ||
} | ||
}); | ||
} | ||
}); | ||
if(!obj && err) | ||
@@ -154,2 +129,4 @@ { | ||
log(device); | ||
this.storage.add(device, (err) => { | ||
@@ -161,2 +138,27 @@ | ||
} | ||
var pathname = this.cacheDirectory + 'storage.json'; | ||
fs.exists(pathname, function (exist) | ||
{ | ||
if(!exist) | ||
{ | ||
log('\x1b[31m%s\x1b[0m', "[ERROR]", pathname + ' wurde nicht gefunden!'); | ||
} | ||
else | ||
{ | ||
fs.readFile(pathname, function(err, data) | ||
{ | ||
if(err) | ||
{ | ||
log('\x1b[31m%s\x1b[0m', "[ERROR]", 'Die Seite konnte nicht geladen werden: ' + err); | ||
} | ||
else | ||
{ | ||
log('\x1b[32m%s\x1b[0m', "[SUCCESS]", pathname); | ||
log(data.toString()); | ||
} | ||
}); | ||
} | ||
}); | ||
}); | ||
@@ -202,2 +204,4 @@ } | ||
log(obj); | ||
this.storage.add(obj, (err) => { | ||
@@ -209,2 +213,27 @@ | ||
} | ||
var pathname = this.cacheDirectory + 'storage.json'; | ||
fs.exists(pathname, function (exist) | ||
{ | ||
if(!exist) | ||
{ | ||
log('\x1b[31m%s\x1b[0m', "[ERROR]", pathname + ' wurde nicht gefunden!'); | ||
} | ||
else | ||
{ | ||
fs.readFile(pathname, function(err, data) | ||
{ | ||
if(err) | ||
{ | ||
log('\x1b[31m%s\x1b[0m', "[ERROR]", 'Die Seite konnte nicht geladen werden: ' + err); | ||
} | ||
else | ||
{ | ||
log('\x1b[32m%s\x1b[0m', "[SUCCESS]", pathname); | ||
log(data.toString()); | ||
} | ||
}); | ||
} | ||
}); | ||
}); | ||
@@ -246,3 +275,3 @@ } | ||
} | ||
/* | ||
if(obj && obj.devices) | ||
@@ -252,2 +281,3 @@ { | ||
} | ||
*/ | ||
}); | ||
@@ -254,0 +284,0 @@ |
{ | ||
"name": "homebridge-syntex-webhooks", | ||
"version": "1.0.5-b18", | ||
"version": "1.0.5-b19", | ||
"description": "A webhook plugin for HTTP devices", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34882
617