From d4d376f23e4b5932bb15a523f73586e8966e748a Mon Sep 17 00:00:00 2001 From: Paul Warren Date: Sun, 1 Dec 2019 19:18:20 +1100 Subject: [PATCH] Adjust weather image placement --- bom_xml.py | 2 +- esp_time.ino | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/bom_xml.py b/bom_xml.py index 29be14a..5a66957 100755 --- a/bom_xml.py +++ b/bom_xml.py @@ -47,7 +47,7 @@ weather = {} # The first forecast period doesn't always have the temperature and other bits # I get the overnight low and forecast to substitute when this happens. -if (type(belco['forecast-period'][0]) == type(collections.OrderedDict())): +if (type(belco['forecast-period'][0]['element']) == type(collections.OrderedDict())): night = 1 else: night = 0 diff --git a/esp_time.ino b/esp_time.ino index 863fb07..3020002 100644 --- a/esp_time.ino +++ b/esp_time.ino @@ -269,28 +269,30 @@ void weatherUpdate(void) { epd_set_en_font(ASCII64); //Today + epd_disp_bitmap(today_icon, 0, 290); + wait(); epd_disp_string(today_day, 0, 536); wait(); - epd_disp_string(today_max, 20, 422); - wait(); - epd_disp_bitmap(today_icon, 0, 318); + epd_disp_string(today_max, 75, 460); wait(); + //Tomorrow - epd_disp_string(tomorrow_day, 267, 536); + epd_disp_bitmap(tomorrow_icon, 267, 290); wait(); - epd_disp_string(tomorrow_max, 297, 422); + epd_disp_string(tomorrow_day, 260, 536); wait(); - epd_disp_bitmap(tomorrow_icon, 267, 318); + epd_disp_string(tomorrow_max, 352, 460); wait(); - + //Day After + epd_disp_bitmap(day_after_icon, 533, 290); + wait(); epd_disp_string(day_after_day, 533, 536); wait(); - epd_disp_string(day_after_max, 563, 422); - wait(); - epd_disp_bitmap(day_after_icon, 533, 318); + epd_disp_string(day_after_max, 615, 460); wait(); + } else { Serial.print("Error on HTTP Request: ");