Stephen Vanderwarker 7 months ago
commit 1573f91271
Signed by: stephen
GPG Key ID: EF429EF847868C14

@ -130,10 +130,9 @@ try {
// check for debugging
function debug() {
if (debugging === '1') {
console.log('-------------');
console.log('[DEBUG]');
console.log(message);
console.log(from);
console.log('-------------');
};
}
function resError(error,res){
@ -221,18 +220,7 @@ try {
});
debug();
}
if (!error && res.statusCode == 401) {
console.log('Invalid credentials');
xmpp.send(from, 'Invalid credentials');
}
if (!error && res.statusCode == 404) {
console.log('Record not found');
xmpp.send(from, 'Record not found');
}
if (!error && res.statusCode == 500) {
console.log('Server error.');
xmpp.send(from, 'Server error. Please ping admin');
}
resError(error,res);
});
debug();
}
@ -335,7 +323,6 @@ try {
if (!error && res.statusCode == 200) {
xmpp.send(from, tuya_name + " set to " + per + "%");
console.log(tuya_name + " set to " + per + "%");
}
resError(error,res);
});