|
|
|
@ -256,11 +256,6 @@ void weatherUpdate(void) {
|
|
|
|
|
int httpCode = http.GET();
|
|
|
|
|
|
|
|
|
|
if (httpCode > 0) {
|
|
|
|
|
/* ArduinoJson v5 bits JsonObject& root = jsonBuffer.parseObject(http.getString());
|
|
|
|
|
if (!root.success()) {
|
|
|
|
|
Serial.print(F("parseObject() failed: "));
|
|
|
|
|
return; */
|
|
|
|
|
|
|
|
|
|
auto error = deserializeJson(jsonBuffer, http.getString());
|
|
|
|
|
if (error) {
|
|
|
|
|
Serial.print("Failed to parse json");
|
|
|
|
@ -268,22 +263,18 @@ void weatherUpdate(void) {
|
|
|
|
|
}
|
|
|
|
|
http.end();
|
|
|
|
|
|
|
|
|
|
//JsonObject& today = jsonBuffer["today"];
|
|
|
|
|
const char* today_day = jsonBuffer["today"]["day"]; // "Wednesday"
|
|
|
|
|
const char* today_icon = jsonBuffer["today"]["icon"]; // "sunny.jpg"
|
|
|
|
|
const char* today_max = jsonBuffer["today"]["max"]; // "27"
|
|
|
|
|
|
|
|
|
|
//JsonObject& tomorrow = jsonBuffer["tomorrow"];
|
|
|
|
|
const char* tomorrow_day = jsonBuffer["tomorrow"]["day"]; // "Thursday"
|
|
|
|
|
const char* tomorrow_icon = jsonBuffer["tomorrow"]["icon"]; // "sunny.jpg"
|
|
|
|
|
const char* tomorrow_max = jsonBuffer["tomorrow"]["max"]; // "31"
|
|
|
|
|
|
|
|
|
|
//JsonObject& day_after = jsonBuffer["day_after"];
|
|
|
|
|
const char* day_after_day = jsonBuffer["day_after"]["day"]; // "Friday"
|
|
|
|
|
const char* day_after_icon = jsonBuffer["day_after"]["icon"]; // "pcloud.jpg"
|
|
|
|
|
const char* day_after_max = jsonBuffer["day_after"]["max"]; // "33"
|
|
|
|
|
|
|
|
|
|
//JsonObject& current = jsonBuffer["current"];
|
|
|
|
|
current_outside = jsonBuffer["current"]["outside"];
|
|
|
|
|
current_bedroom = jsonBuffer["current"]["bedroom"];
|
|
|
|
|
current_lounge = jsonBuffer["current"]["lounge"];
|
|
|
|
@ -297,7 +288,6 @@ void weatherUpdate(void) {
|
|
|
|
|
epd_disp_string(today_day, 0, 536);
|
|
|
|
|
epd_disp_string(today_max, 75, 460);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//Tomorrow
|
|
|
|
|
epd_disp_bitmap(tomorrow_icon, 267, 290);
|
|
|
|
|
epd_disp_string(tomorrow_day, 260, 536);
|
|
|
|
@ -308,7 +298,6 @@ void weatherUpdate(void) {
|
|
|
|
|
epd_disp_string(day_after_day, 533, 536);
|
|
|
|
|
epd_disp_string(day_after_max, 615, 460);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Serial.println("Adding Temps");
|
|
|
|
|
sprintf(buf, "E: %s I: %s",
|
|
|
|
|
current_outside,
|
|
|
|
|