From c94bacb71eeb178b5650fa552cb6f57e6fd99936 Mon Sep 17 00:00:00 2001 From: Karl Hudgell Date: Mon, 28 Sep 2020 16:14:42 +0100 Subject: [PATCH] move currentTemp --- libs/lcd.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/lcd.js b/libs/lcd.js index aad14b0..21228da 100644 --- a/libs/lcd.js +++ b/libs/lcd.js @@ -95,7 +95,13 @@ module.exports = { }, weather: async (city, weatherDescription, currentTemp, highTemp, lowTemp) => { weatherDescription = weatherDescription.replace(/(^\w{1})|(\s{1}\w{1})/g, match => match.toUpperCase()); - lcd.printLineSync(2, weatherDescription + ' - ' + currentTemp + '\xDF') + if (currentTemp.toString().length == 2) { + lcd.printLineSync(1, ' ' + currentTemp + '\xDF') + } else { + lcd.printLineSync(1, ' ' + currentTemp + '\xDF') + } + + lcd.printLineSync(2, weatherDescription) lcd.printLineSync(3, 'High-' + highTemp + '\xDF' + ' / ' + 'Low-' + lowTemp + '\xDF') } } \ No newline at end of file