From 6b76639156888c58c57e9263f3a4efc596a61157 Mon Sep 17 00:00:00 2001 From: "Marshall G. Gates" Date: Fri, 24 Nov 2023 16:54:16 -0500 Subject: [PATCH 01/17] Unified Info and Warning debug message types --- include/effects/matrix/PatternWeather.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/effects/matrix/PatternWeather.h b/include/effects/matrix/PatternWeather.h index 372521715..4a289f3be 100644 --- a/include/effects/matrix/PatternWeather.h +++ b/include/effects/matrix/PatternWeather.h @@ -320,7 +320,7 @@ class PatternWeather : public LEDStripEffect { while(!WiFi.isConnected()) { - debugI("Delaying Weather update, waiting for WiFi..."); + debugW("Delaying Weather update, waiting for WiFi..."); vTaskDelay(pdMS_TO_TICKS(WEATHER_CHECK_WIFI_WAIT)); } @@ -328,7 +328,7 @@ class PatternWeather : public LEDStripEffect if (getWeatherData()) { - debugW("Got today's weather"); + debugI("Got today's weather"); if (getTomorrowTemps(highTomorrow, loTomorrow)) { debugI("Got tomorrow's weather"); @@ -399,7 +399,7 @@ class PatternWeather : public LEDStripEffect { latestUpdate = now; - debugW("Triggering thread to check weather now..."); + debugI("Triggering thread to check weather now..."); // Trigger the weather reader. g_ptrSystem->NetworkReader().FlagReader(readerIndex); } From ef17b52587b0f7875393163f2af9472f0cc7cb5c Mon Sep 17 00:00:00 2001 From: "Marshall G. Gates" Date: Fri, 24 Nov 2023 16:56:00 -0500 Subject: [PATCH 02/17] Convert refresh delay to use std::chrono --- include/effects/matrix/PatternWeather.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/effects/matrix/PatternWeather.h b/include/effects/matrix/PatternWeather.h index 4a289f3be..38aac2417 100644 --- a/include/effects/matrix/PatternWeather.h +++ b/include/effects/matrix/PatternWeather.h @@ -42,13 +42,14 @@ #include #include "systemcontainer.h" #include +#include #include #include #include "TJpg_Decoder.h" #include "effects.h" #include "types.h" -#define WEATHER_INTERVAL_SECONDS (10*60) +#define WEATHER_INTERVAL_SECONDS std::chrono::seconds{(10*60)} #define WEATHER_CHECK_WIFI_WAIT 5000 extern const uint8_t brokenclouds_start[] asm("_binary_assets_bmp_brokenclouds_jpg_start"); @@ -133,7 +134,7 @@ class PatternWeather : public LEDStripEffect bool dataReady = false; size_t readerIndex = std::numeric_limits::max(); - time_t latestUpdate = 0; + std::chrono::system_clock::time_point latestUpdate = std::chrono::system_clock::from_time_t(0); // The weather is obviously weather, and we don't want text overlaid on top of our text @@ -388,14 +389,13 @@ class PatternWeather : public LEDStripEffect g()->setFont(&Apple5x7); - time_t now; - time(&now); + auto now = std::chrono::system_clock::now(); auto secondsSinceLastUpdate = now - latestUpdate; // If location and/or country have changed, trigger an update regardless of timer, but // not more than once every half a minute - if (secondsSinceLastUpdate >= WEATHER_INTERVAL_SECONDS || (HasLocationChanged() && secondsSinceLastUpdate >= 30)) + if (secondsSinceLastUpdate >= WEATHER_INTERVAL_SECONDS || (HasLocationChanged() && secondsSinceLastUpdate >= std::chrono::seconds{30})) { latestUpdate = now; From 967d87133f80a458cd56a3cd36fe21808b29263d Mon Sep 17 00:00:00 2001 From: "Marshall G. Gates" Date: Sat, 25 Nov 2023 00:01:36 -0500 Subject: [PATCH 03/17] Update getTomorrowTemps - Use the std::chrono library for time related data - Actually scan all the forcast blocks for tomorrow - Get the noon weather icon for tomorrow --- include/effects/matrix/PatternWeather.h | 52 ++++++++++++++++++------- 1 file changed, 38 insertions(+), 14 deletions(-) diff --git a/include/effects/matrix/PatternWeather.h b/include/effects/matrix/PatternWeather.h index 38aac2417..648c2bfcc 100644 --- a/include/effects/matrix/PatternWeather.h +++ b/include/effects/matrix/PatternWeather.h @@ -224,7 +224,7 @@ class PatternWeather : public LEDStripEffect { HTTPClient http; String url = "http://api.openweathermap.org/data/2.5/forecast" - "?lat=" + strLatitude + "&lon=" + strLongitude + "&appid=" + urlEncode(g_ptrSystem->DeviceConfig().GetOpenWeatherAPIKey()); + "?lat=" + strLatitude + "&lon=" + strLongitude + "&cnt=16&appid=" + urlEncode(g_ptrSystem->DeviceConfig().GetOpenWeatherAPIKey()); http.begin(url); int httpResponseCode = http.GET(); @@ -235,33 +235,57 @@ class PatternWeather : public LEDStripEffect JsonArray list = doc["list"]; // Get tomorrow's date - time_t tomorrow = time(nullptr) + 86400; - tm* tomorrowTime = localtime(&tomorrow); + auto tomorrow = std::chrono::system_clock::now() + std::chrono::hours{24}; + auto tomorrow_timet = std::chrono::system_clock::to_time_t(tomorrow); + auto tomorrowTime = localtime(&tomorrow_timet); char dateStr[11]; strftime(dateStr, sizeof(dateStr), "%Y-%m-%d", tomorrowTime); + float localMin = 999.0; + float localMax = 0.0; + int slot = 0; + iconTomorrow = ""; // Look for the temperature data for tomorrow for (size_t i = 0; i < list.size(); ++i) { JsonObject entry = list[i]; - String dt_txt = entry["dt_txt"]; - if (dt_txt.startsWith(dateStr)) + // convert the entry UTC to localtime + time_t entry_time = entry["dt"]; + tm* entryLocal = localtime(&entry_time); + char entryStr[11]; + strftime(entryStr, sizeof(entryStr), "%Y-%m-%d", entryLocal); + + // if it is tomorrow then figure out the min and max and get the icon + if (strcmp(dateStr, entryStr) == 0) { - //Serial.printf("Weather: Updating Forecast: %s", response.c_str()); + slot++; JsonObject main = entry["main"]; - if (main["temp_max"] > 0) - highTemp = KelvinToLocal(main["temp_max"]); - if (main["temp_min"] > 0) - lowTemp = KelvinToLocal(main["temp_min"]); - - iconTomorrow = entry["weather"][0]["icon"].as(); - debugI("Got tomorrow's temps: Lo %d, Hi %d, Icon %s", (int)lowTemp, (int)highTemp, iconTomorrow.c_str()); - break; + // Identify the maximum of the maximum temperature + float temp_max = main["temp_max"]; + if ((temp_max > 0) && (temp_max > localMax)) + localMax = temp_max; + + // Identify the minimum of the mimimum temperatures + float temp_min = main["temp_min"]; + if ((temp_min > 0) && (temp_min < localMin)) + localMin = temp_min; + + // Use the noon slot for the icon + if (slot == 4) + { + iconTomorrow = entry["weather"][0]["icon"].as(); + } } } + + highTemp = KelvinToLocal(localMax); + lowTemp = KelvinToLocal(localMin); + + debugI("Got tomorrow's temps: Lo %d, Hi %d, Icon %s", (int)lowTemp, (int)highTemp, iconTomorrow.c_str()); + http.end(); return true; } From 298e7289d14e8986260205de23a22c4f7211ee82 Mon Sep 17 00:00:00 2001 From: "Marshall G. Gates" Date: Sat, 25 Nov 2023 15:41:56 -0500 Subject: [PATCH 04/17] Increase Allocated JSON Document size to capture all the forcast data --- include/effects/matrix/PatternWeather.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/effects/matrix/PatternWeather.h b/include/effects/matrix/PatternWeather.h index 648c2bfcc..af614436e 100644 --- a/include/effects/matrix/PatternWeather.h +++ b/include/effects/matrix/PatternWeather.h @@ -230,7 +230,8 @@ class PatternWeather : public LEDStripEffect if (httpResponseCode > 0) { - AllocatedJsonDocument doc(4096); + // Needs to be this large to process all the returned JSON + AllocatedJsonDocument doc(10240); deserializeJson(doc, http.getString()); JsonArray list = doc["list"]; @@ -251,6 +252,7 @@ class PatternWeather : public LEDStripEffect for (size_t i = 0; i < list.size(); ++i) { JsonObject entry = list[i]; + // convert the entry UTC to localtime time_t entry_time = entry["dt"]; tm* entryLocal = localtime(&entry_time); From da06746b76ca2c0ba3c6a39cda4c9402b2d9e3a0 Mon Sep 17 00:00:00 2001 From: "Marshall G. Gates" Date: Sun, 26 Nov 2023 12:32:13 -0500 Subject: [PATCH 05/17] Reformat single statement ifs to match Just getting it all to look the same inside the file --- include/effects/matrix/PatternWeather.h | 8 -------- 1 file changed, 8 deletions(-) diff --git a/include/effects/matrix/PatternWeather.h b/include/effects/matrix/PatternWeather.h index af614436e..b3e7736b1 100644 --- a/include/effects/matrix/PatternWeather.h +++ b/include/effects/matrix/PatternWeather.h @@ -277,9 +277,7 @@ class PatternWeather : public LEDStripEffect // Use the noon slot for the icon if (slot == 4) - { iconTomorrow = entry["weather"][0]["icon"].as(); - } } } @@ -357,18 +355,12 @@ class PatternWeather : public LEDStripEffect { debugI("Got today's weather"); if (getTomorrowTemps(highTomorrow, loTomorrow)) - { debugI("Got tomorrow's weather"); - } else - { debugW("Failed to get tomorrow's weather"); - } } else - { debugW("Failed to get today's weather"); - } } bool HasLocationChanged() From 2d75c26b923bc667969a6e17de0c41e171861769 Mon Sep 17 00:00:00 2001 From: "Marshall G. Gates" Date: Tue, 28 Nov 2023 10:16:38 -0500 Subject: [PATCH 06/17] Properly include the std::chrono namespaces - better time constant expressions - Remove unneeded namespace prefixes --- include/effects/matrix/PatternWeather.h | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/include/effects/matrix/PatternWeather.h b/include/effects/matrix/PatternWeather.h index 010fd5d3e..5426591ca 100644 --- a/include/effects/matrix/PatternWeather.h +++ b/include/effects/matrix/PatternWeather.h @@ -49,7 +49,10 @@ #include "effects.h" #include "types.h" -#define WEATHER_INTERVAL_SECONDS std::chrono::seconds{(10*60)} +using namespace std::chrono; +using namespace std::chrono_literals; + +#define WEATHER_INTERVAL_SECONDS 600s #define WEATHER_CHECK_WIFI_WAIT 5000 extern const uint8_t brokenclouds_start[] asm("_binary_assets_bmp_brokenclouds_jpg_start"); @@ -134,7 +137,7 @@ class PatternWeather : public LEDStripEffect bool dataReady = false; size_t readerIndex = std::numeric_limits::max(); - std::chrono::system_clock::time_point latestUpdate = std::chrono::system_clock::from_time_t(0); + system_clock::time_point latestUpdate = system_clock::from_time_t(0); // The weather is obviously weather, and we don't want text overlaid on top of our text @@ -235,8 +238,8 @@ class PatternWeather : public LEDStripEffect JsonArray list = doc["list"]; // Get tomorrow's date - auto tomorrow = std::chrono::system_clock::now() + std::chrono::hours{24}; - auto tomorrow_timet = std::chrono::system_clock::to_time_t(tomorrow); + auto tomorrow = system_clock::now() + hours{24}; + auto tomorrow_timet = system_clock::to_time_t(tomorrow); auto tomorrowTime = localtime(&tomorrow_timet); char dateStr[11]; strftime(dateStr, sizeof(dateStr), "%Y-%m-%d", tomorrowTime); @@ -406,13 +409,13 @@ class PatternWeather : public LEDStripEffect g()->setFont(&Apple5x7); - auto now = std::chrono::system_clock::now(); + auto now = system_clock::now(); auto secondsSinceLastUpdate = now - latestUpdate; // If location and/or country have changed, trigger an update regardless of timer, but // not more than once every half a minute - if (secondsSinceLastUpdate >= WEATHER_INTERVAL_SECONDS || (HasLocationChanged() && secondsSinceLastUpdate >= std::chrono::seconds{30})) + if (secondsSinceLastUpdate >= WEATHER_INTERVAL_SECONDS || (HasLocationChanged() && secondsSinceLastUpdate >= 30s)) { latestUpdate = now; From e9891e0dd7124e454e7f05c2abd4a73bb9a80f5f Mon Sep 17 00:00:00 2001 From: "Marshall G. Gates" Date: Tue, 28 Nov 2023 10:28:54 -0500 Subject: [PATCH 07/17] Clean up debug logging - Correct debug level - Remove redunant logging --- include/effects/matrix/PatternWeather.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/include/effects/matrix/PatternWeather.h b/include/effects/matrix/PatternWeather.h index 5426591ca..fd1f31710 100644 --- a/include/effects/matrix/PatternWeather.h +++ b/include/effects/matrix/PatternWeather.h @@ -293,7 +293,7 @@ class PatternWeather : public LEDStripEffect } else { - debugW("Error fetching forecast data for location: %s in country: %s", strLocation.c_str(), strCountryCode.c_str()); + debugE("Error fetching forecast data for location: %s in country: %s", strLocation.c_str(), strCountryCode.c_str()); http.end(); return false; } @@ -337,7 +337,7 @@ class PatternWeather : public LEDStripEffect } else { - debugW("Error fetching Weather data for location: %s in country: %s", strLocation.c_str(), strCountryCode.c_str()); + debugE("Error fetching Weather data for location: %s in country: %s", strLocation.c_str(), strCountryCode.c_str()); http.end(); return false; } @@ -354,15 +354,7 @@ class PatternWeather : public LEDStripEffect updateCoordinates(); if (getWeatherData()) - { - debugI("Got today's weather"); - if (getTomorrowTemps(highTomorrow, loTomorrow)) - debugI("Got tomorrow's weather"); - else - debugW("Failed to get tomorrow's weather"); - } - else - debugW("Failed to get today's weather"); + getTomorrowTemps(highTomorrow, loTomorrow); } bool HasLocationChanged() From ff1587b0ece8cc8ef8a1ce9677bad4c1848f2ca0 Mon Sep 17 00:00:00 2001 From: "Marshall G. Gates" Date: Wed, 29 Nov 2023 07:56:01 -0500 Subject: [PATCH 08/17] Addressed issues in Pull Request - Cleaned up variable naming format. We really need a standard. I am open to anything. - Used std::min and std::max to clarify the codes meaning --- include/effects/matrix/PatternWeather.h | 36 ++++++++++++------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/include/effects/matrix/PatternWeather.h b/include/effects/matrix/PatternWeather.h index fd1f31710..1aa31b66c 100644 --- a/include/effects/matrix/PatternWeather.h +++ b/include/effects/matrix/PatternWeather.h @@ -238,14 +238,14 @@ class PatternWeather : public LEDStripEffect JsonArray list = doc["list"]; // Get tomorrow's date - auto tomorrow = system_clock::now() + hours{24}; - auto tomorrow_timet = system_clock::to_time_t(tomorrow); - auto tomorrowTime = localtime(&tomorrow_timet); + auto tomorrow = system_clock::now() + 24h; + auto tomorrowTime = system_clock::to_time_t(tomorrow); + auto tomorrowLocal = localtime(&tomorrowTime); char dateStr[11]; - strftime(dateStr, sizeof(dateStr), "%Y-%m-%d", tomorrowTime); + strftime(dateStr, sizeof(dateStr), "%Y-%m-%d", tomorrowLocal); - float localMin = 999.0; - float localMax = 0.0; + float dailyMinimum = 999.0; + float dailyMaximum = 0.0; int slot = 0; iconTomorrow = ""; @@ -256,8 +256,8 @@ class PatternWeather : public LEDStripEffect JsonObject entry = list[i]; // convert the entry UTC to localtime - time_t entry_time = entry["dt"]; - tm* entryLocal = localtime(&entry_time); + time_t entryTime = entry["dt"]; + tm* entryLocal = localtime(&entryTime); char entryStr[11]; strftime(entryStr, sizeof(entryStr), "%Y-%m-%d", entryLocal); @@ -267,15 +267,15 @@ class PatternWeather : public LEDStripEffect slot++; JsonObject main = entry["main"]; - // Identify the maximum of the maximum temperature - float temp_max = main["temp_max"]; - if ((temp_max > 0) && (temp_max > localMax)) - localMax = temp_max; + // Identify the maximum of the 3 hour maximum temperature + float entryMaximum = main["temp_max"]; + if (entryMaximum > 0) + dailyMaximum = std::max(dailyMaximum, entryMaximum); - // Identify the minimum of the mimimum temperatures - float temp_min = main["temp_min"]; - if ((temp_min > 0) && (temp_min < localMin)) - localMin = temp_min; + // Identify the minimum of the 3 hour mimimum temperatures + float entryMinimum = main["temp_min"]; + if (entryMinimum > 0) + dailyMinimum = std::min(dailyMinimum, entryMinimum); // Use the noon slot for the icon if (slot == 4) @@ -283,8 +283,8 @@ class PatternWeather : public LEDStripEffect } } - highTemp = KelvinToLocal(localMax); - lowTemp = KelvinToLocal(localMin); + highTemp = KelvinToLocal(dailyMaximum); + lowTemp = KelvinToLocal(dailyMinimum); debugI("Got tomorrow's temps: Lo %d, Hi %d, Icon %s", (int)lowTemp, (int)highTemp, iconTomorrow.c_str()); From c393143d7ef423f2546590a578713df919e589a0 Mon Sep 17 00:00:00 2001 From: Joe Schneider Date: Wed, 29 Nov 2023 20:41:52 -0500 Subject: [PATCH 09/17] Create logic to include optional custom_globals.h Checks for the existence of `custom_globals.h`. This file can include logic to select user specified projects instead of cluttering globals.h --- include/globals.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/globals.h b/include/globals.h index b5a128563..e4a48a76b 100644 --- a/include/globals.h +++ b/include/globals.h @@ -237,7 +237,16 @@ extern RemoteDebug Debug; // Let everyone in the project know about it // LEDs, how many, on how many channels, laid out into how many fans/rings, and so on. You can also // specify the audio system config like how many band channels. -#if DEMO +#if __has_include ("custom_globals.h") + + // To reduce clutter, you may choose to create a new file called `custom_globals.h` in the `includes` directory. + // You can place your project configurations and logic to select them in that file. + // This can be done once you know how `platformio.ini` and `globals.h` interact with one another + // to create different environments and projects. + + #include "custom_globals.h" + +#elif DEMO // This is a simple demo configuration. To build, simply connect the data lead from a WS2812B // strip to pin 5 or other pin marked PIN0 below. This does not use the OLED, LCD, or anything fancy, it simply drives the From 173e522942623b4d0db9368524bed87f186bab39 Mon Sep 17 00:00:00 2001 From: Joe Schneider Date: Thu, 30 Nov 2023 08:11:50 -0500 Subject: [PATCH 10/17] Small adjustments Added entries in .gitignore to ignore user configuration files. Also added line in platformio.ini to include an external config file. If the file does not exist, platformio ignores it. If it does exist, it will read from it. No logic necessary. --- .gitignore | 4 +++- platformio.ini | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ca31aeb9e..18b9ecea2 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,6 @@ WebInstaller/index.html .idea/** tools/__pycache__ site/yarn-error.log -site/dist \ No newline at end of file +site/dist +**/custom_*.h +**/extra_*.ini \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 8c88d25dd..298942c58 100644 --- a/platformio.ini +++ b/platformio.ini @@ -21,6 +21,8 @@ [platformio] default_envs = build_cache_dir = .pio/build_cache +extra_configs = + extra_envs.ini ; This file can be created in the root directory to store user defined devices and environments. ; ================== ; Base configuration From 899393ac909dc8a12bfb7f5e87f4ad32d33752dd Mon Sep 17 00:00:00 2001 From: Joe Schneider Date: Thu, 30 Nov 2023 08:14:43 -0500 Subject: [PATCH 11/17] slight variable name change --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 298942c58..f30c1525c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -22,7 +22,7 @@ default_envs = build_cache_dir = .pio/build_cache extra_configs = - extra_envs.ini ; This file can be created in the root directory to store user defined devices and environments. + user_envs.ini ; This file can be created in the root directory to store user defined devices and environments. ; ================== ; Base configuration From f5673a653373682c82923bc1f2001c9675a1f79a Mon Sep 17 00:00:00 2001 From: Joe Schneider Date: Thu, 30 Nov 2023 08:15:21 -0500 Subject: [PATCH 12/17] slight change to go along with last commit --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 18b9ecea2..4eb8c2527 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ tools/__pycache__ site/yarn-error.log site/dist **/custom_*.h -**/extra_*.ini \ No newline at end of file +**/user_*.ini \ No newline at end of file From 5fc8ba17878d267cd83355bd91d9dedbf082140a Mon Sep 17 00:00:00 2001 From: Joe Schneider Date: Thu, 30 Nov 2023 14:39:16 -0500 Subject: [PATCH 13/17] Changed platoformio include name custom makes more sense than user. --- .gitignore | 2 +- platformio.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4eb8c2527..f5ebf5a5c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ tools/__pycache__ site/yarn-error.log site/dist **/custom_*.h -**/user_*.ini \ No newline at end of file +**/custom_*.ini \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index f30c1525c..7b8e742ee 100644 --- a/platformio.ini +++ b/platformio.ini @@ -22,7 +22,7 @@ default_envs = build_cache_dir = .pio/build_cache extra_configs = - user_envs.ini ; This file can be created in the root directory to store user defined devices and environments. + custom_envs.ini ; This file can be created in the root directory to store user defined devices and environments. ; ================== ; Base configuration From 358b68ca574873cd64044b9d3da4f76002f3211f Mon Sep 17 00:00:00 2001 From: Joe Schneider Date: Thu, 30 Nov 2023 14:46:49 -0500 Subject: [PATCH 14/17] One more tweak to platoformio.ini Changed to allow loading multiple configs that start with `custom_` --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 7b8e742ee..4167749ba 100644 --- a/platformio.ini +++ b/platformio.ini @@ -22,7 +22,7 @@ default_envs = build_cache_dir = .pio/build_cache extra_configs = - custom_envs.ini ; This file can be created in the root directory to store user defined devices and environments. + custom_*.ini ; This file can be created in the root directory to store user defined devices and environments. ; ================== ; Base configuration From 763f82c66f7b99ba38ac1a96c83dba92c66a40eb Mon Sep 17 00:00:00 2001 From: "Marshall G. Gates" Date: Thu, 30 Nov 2023 17:45:36 -0500 Subject: [PATCH 15/17] Addressed Code Review Comments --- include/effects/matrix/PatternWeather.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/effects/matrix/PatternWeather.h b/include/effects/matrix/PatternWeather.h index 1aa31b66c..6283197a0 100644 --- a/include/effects/matrix/PatternWeather.h +++ b/include/effects/matrix/PatternWeather.h @@ -269,8 +269,7 @@ class PatternWeather : public LEDStripEffect // Identify the maximum of the 3 hour maximum temperature float entryMaximum = main["temp_max"]; - if (entryMaximum > 0) - dailyMaximum = std::max(dailyMaximum, entryMaximum); + dailyMaximum = std::max(dailyMaximum, entryMaximum); // Identify the minimum of the 3 hour mimimum temperatures float entryMinimum = main["temp_min"]; From 7241008d762673831c253c74fd4b36cd9ce8db14 Mon Sep 17 00:00:00 2001 From: Joe Schneider Date: Thu, 30 Nov 2023 19:37:02 -0500 Subject: [PATCH 16/17] Update .gitignore Removed recursive directory exclusion --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f5ebf5a5c..f3e185719 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ tools/__pycache__ site/yarn-error.log site/dist **/custom_*.h -**/custom_*.ini \ No newline at end of file +custom_*.ini From c3ee5476b37123e4bb2628791b31d225aebae4c9 Mon Sep 17 00:00:00 2001 From: Joe Schneider Date: Thu, 30 Nov 2023 21:37:23 -0500 Subject: [PATCH 17/17] removed extra new line at end of file I tried to remove the newline via the GH web interface but it didn't show a line 26. --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f3e185719..27270e5cf 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,4 @@ tools/__pycache__ site/yarn-error.log site/dist **/custom_*.h -custom_*.ini +custom_*.ini \ No newline at end of file