Skip to content

Commit

Permalink
improve output
Browse files Browse the repository at this point in the history
  • Loading branch information
fscherwi committed Dec 29, 2017
1 parent c4de537 commit 6201e5d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/weather.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,14 @@ function error_output(code) {
}
}
/* istanbul ignore next */
function output(){
console.log('\nRelative Humidity:\t' + output_data[0] + '\n' +
'Air pressure:\t\t' + output_data[1] + '\n' +
'Temperature:\t\t' + output_data[2] + '\n' +
'Illuminance:\t\t' + output_data[3] + '\n' +
'\nTime:\t\t\t' + getTime(new Date()) + '\n');
}
/* istanbul ignore next */
function simple(HOST, PORT, WAIT) {
setTimeout(function () {
tfinit(HOST, PORT);
Expand All @@ -134,11 +142,7 @@ function simple(HOST, PORT, WAIT) {
}
);
setTimeout(function () {
console.log('\nRelative Humidity:\t' + output_data[0] + '\n' +
'Air pressure:\t\t' + output_data[1] + '\n' +
'Temperature:\t\t' + output_data[2] + '\n' +
'Illuminance:\t\t' + output_data[3] + '\n' +
'\nTime:\t\t\t' + getTime(new Date()) + '\n');
output();
ipcon.disconnect();
process.exit(0);
}, 10);
Expand All @@ -161,11 +165,7 @@ function live(HOST, PORT, WAIT) {
setInterval(function () {
tfdata_get();
console.log('\033[2J');
console.log('\nRelative Humidity:\t' + output_data[0] + '\n' +
'Air pressure:\t\t' + output_data[1] + '\n' +
'Temperature:\t\t' + output_data[2] + '\n' +
'Illuminance:\t\t' + output_data[3] + '\n' +
'\nTime:\t\t\t' + getTime(new Date()) + '\n');
output();
}, WAIT);
}, 25);
}
Expand Down

0 comments on commit 6201e5d

Please sign in to comment.