wfdudley / T-watch-2020

a watch project for the TTGO T-watch-2020 version 1
BSD 3-Clause "New" or "Revised" License
84 stars 27 forks source link

appWeather.cpp units #36

Closed AffekeNommu closed 3 years ago

AffekeNommu commented 3 years ago

Hi, As I am using centigrade I noticed a few issues with the weather app module. Formatting and units mostly.

Just a few lines to change to correct this so listing them below:

378
-   tft->printf("%.0f %c hi %.0f lo",
+   tft->printf("%.0f %c hi %.0f %c lo",

381
-     OWOC.forecast[0].temperatureLow
+     OWOC.forecast[0].temperatureLow,temp_unit

435
-     tft->printf("%.0f F hi", OWOC.forecast[fo].temperatureHigh);
+     tft->printf("%.0f %c hi", OWOC.forecast[fo].temperatureHigh,temp_unit);

438
-     tft->printf("%.0f F lo", OWOC.forecast[fo].temperatureLow);
+     tft->printf("%.0f %c lo", OWOC.forecast[fo].temperatureLow, temp_unit);

525
-     tft->printf("%.0f F hi", OWOC.forecast[fo].temperatureHigh);
+     tft->printf("%.0f %c hi", OWOC.forecast[fo].temperatureHigh, temp_unit);

528 
-     tft->printf("%.0f F lo", OWOC.forecast[fo].temperatureLow);
+     tft->printf("%.0f %c lo", OWOC.forecast[fo].temperatureLow, temp_unit);
wfdudley commented 3 years ago

I'm not making the first change because it was a conscious decision to leave out the units for the second temperatre. The reason is if both temperatures are over 99F, then the length of the line will exceed the space (if both temp units are displayed). The other changes are good, I have implemented them.