|
27 | 27 |
|
28 | 28 | #include "Settings.h"
|
29 | 29 |
|
30 |
| -#define VERSION "2.16" |
| 30 | +#define VERSION "2.18" |
31 | 31 |
|
32 | 32 | #define HOSTNAME "CLOCK-"
|
33 | 33 | #define CONFIG "/conf.txt"
|
@@ -108,7 +108,6 @@ static const char WEB_ACTIONS2[] PROGMEM = "<a class='w3-bar-item w3-button' hre
|
108 | 108 |
|
109 | 109 | static const char WEB_ACTION3[] PROGMEM = "</a><a class='w3-bar-item w3-button' href='/systemreset' onclick='return confirm(\"Do you want to reset to default weather settings?\")'><i class='fas fa-undo'></i> Reset Settings</a>"
|
110 | 110 | "<a class='w3-bar-item w3-button' href='/forgetwifi' onclick='return confirm(\"Do you want to forget to WiFi connection?\")'><i class='fas fa-wifi'></i> Forget WiFi</a>"
|
111 |
| - "<a class='w3-bar-item w3-button' href='/restart'><i class='fas fa-sync'></i> Restart</a>" |
112 | 111 | "<a class='w3-bar-item w3-button' href='/update'><i class='fas fa-wrench'></i> Firmware Update</a>"
|
113 | 112 | "<a class='w3-bar-item w3-button' href='https://github.com/Qrome/marquee-scroller' target='_blank'><i class='fas fa-question-circle'></i> About</a>";
|
114 | 113 |
|
@@ -316,7 +315,6 @@ void setup() {
|
316 | 315 | server.on("/savepihole", handleSavePihole);
|
317 | 316 | server.on("/systemreset", handleSystemReset);
|
318 | 317 | server.on("/forgetwifi", handleForgetWifi);
|
319 |
| - server.on("/restart", restartEsp); |
320 | 318 | server.on("/configure", handleConfigure);
|
321 | 319 | server.on("/configurebitcoin", handleBitcoinConfigure);
|
322 | 320 | server.on("/configurewideclock", handleWideClockConfigure);
|
@@ -447,11 +445,7 @@ void loop() {
|
447 | 445 | if (Wide_Clock_Style == "1") {
|
448 | 446 | // On Wide Display -- show the current temperature as well
|
449 | 447 | String currentTemp = weatherClient.getTempRounded(0);
|
450 |
| - String timeSpacer = " "; |
451 |
| - if (currentTemp.length() >= 3) { |
452 |
| - timeSpacer = " "; |
453 |
| - } |
454 |
| - currentTime += timeSpacer + currentTemp + getTempSymbol(); |
| 448 | + currentTime += " " + currentTemp + getTempSymbol(); |
455 | 449 | }
|
456 | 450 | if (Wide_Clock_Style == "2") {
|
457 | 451 | currentTime += secondsIndicator(false) + TimeDB.zeroPad(second());
|
@@ -629,11 +623,6 @@ void handleForgetWifi() {
|
629 | 623 | ESP.restart();
|
630 | 624 | }
|
631 | 625 |
|
632 |
| -void restartEsp() { |
633 |
| - redirectHome(); |
634 |
| - ESP.restart(); |
635 |
| -} |
636 |
| - |
637 | 626 | void handleBitcoinConfigure() {
|
638 | 627 | if (!athentication()) {
|
639 | 628 | return server.requestAuthentication();
|
@@ -1121,8 +1110,8 @@ void displayWeatherData() {
|
1121 | 1110 | html += "</div>";
|
1122 | 1111 | html += "<div class='w3-cell w3-container' style='width:100%'><p>";
|
1123 | 1112 | html += weatherClient.getCondition(0) + " (" + weatherClient.getDescription(0) + ")<br>";
|
1124 |
| - html += temperature + " " + getTempSymbol() + "<br>"; |
1125 |
| - html += weatherClient.getHigh(0) + "/" + weatherClient.getLow(0) + " " + getTempSymbol() + "<br>"; |
| 1113 | + html += temperature + " " + getTempSymbol(true) + "<br>"; |
| 1114 | + html += weatherClient.getHigh(0) + "/" + weatherClient.getLow(0) + " " + getTempSymbol(true) + "<br>"; |
1126 | 1115 | html += time + "<br>";
|
1127 | 1116 | html += "<a href='https://www.google.com/maps/@" + weatherClient.getLat(0) + "," + weatherClient.getLon(0) + ",10000m/data=!3m1!1e3' target='_BLANK'><i class='fas fa-map-marker' style='color:red'></i> Map It!</a><br>";
|
1128 | 1117 | html += "</p></div></div><hr>";
|
@@ -1220,13 +1209,23 @@ void flashLED(int number, int delayTime) {
|
1220 | 1209 | }
|
1221 | 1210 |
|
1222 | 1211 | String getTempSymbol() {
|
| 1212 | + return getTempSymbol(false); |
| 1213 | +} |
| 1214 | + |
| 1215 | +String getTempSymbol(bool forWeb) { |
1223 | 1216 | String rtnValue = "F";
|
1224 | 1217 | if (IS_METRIC) {
|
1225 | 1218 | rtnValue = "C";
|
1226 | 1219 | }
|
| 1220 | + if (forWeb) { |
| 1221 | + rtnValue = "°" + rtnValue; |
| 1222 | + } else { |
| 1223 | + rtnValue = char(247) + rtnValue; |
| 1224 | + } |
1227 | 1225 | return rtnValue;
|
1228 | 1226 | }
|
1229 | 1227 |
|
| 1228 | + |
1230 | 1229 | String getSpeedSymbol() {
|
1231 | 1230 | String rtnValue = "mph";
|
1232 | 1231 | if (IS_METRIC) {
|
|
0 commit comments