diff --git a/printermonitor/printermonitor.ino b/printermonitor/printermonitor.ino index f8e4916..78c3b87 100644 --- a/printermonitor/printermonitor.ino +++ b/printermonitor/printermonitor.ino @@ -27,7 +27,7 @@ SOFTWARE. #include "Settings.h" -#define VERSION "2.1" +#define VERSION "2.2" #define HOSTNAME "OctMon-" #define CONFIG "/conf.txt" @@ -66,7 +66,7 @@ void drawClockHeaderOverlay(OLEDDisplay *display, OLEDDisplayUiState* state); // Set the number of Frames supported const int numberOfFrames = 3; FrameCallback frames[numberOfFrames]; -FrameCallback clockFrame[20]; +FrameCallback clockFrame[13]; boolean isClockOn = false; OverlayCallback overlays[] = { drawHeaderOverlay }; @@ -519,13 +519,14 @@ void handleNewsConfigure() { digitalWrite(externalLight, LOW); String html = ""; - String NEWS_FORM1 = "
"; server.sendHeader("Cache-Control", "no-cache, no-store"); @@ -545,11 +546,11 @@ void handleNewsConfigure() { form.replace("%NEWSCHECKED%", isNewsDisplayedChecked); form.replace("%NEWSKEY%", NEWS_API_KEY); server.sendContent(form); //Send first Chunk of form - String newsOptions = NEWS_OPTIONS; - newsOptions.replace(">" + NEWS_SOURCE + "<", " selected>" + NEWS_SOURCE + "<"); - server.sendContent(newsOptions); - server.sendContent(NEWS_FORM2); - + server.sendContent(NEWS_OPTIONS); + form = NEWS_FORM2; + form.replace("%NEWSSOURCE%", NEWS_SOURCE); + server.sendContent(form); + html = getFooter(); server.sendContent(html); @@ -797,8 +798,11 @@ void displayPrinterStatus() { html += " Map It!Please Configure News API and News Source
"; } else { @@ -816,7 +820,6 @@ void displayPrinterStatus() { html += ""; } } - } server.sendContent(html); // spit out what we got html = ""; // fresh start } @@ -927,7 +930,7 @@ void drawWeather(OLEDDisplay *display, OLEDDisplayUiState* state, int16_t x, int display->setFont(ArialMT_Plain_16); display->drawString(0 + x, 24 + y, weatherClient.getCondition(0)); - display->setFont(Meteocons_Plain_42); + display->setFont((const uint8_t*)Meteocons_Plain_42); display->drawString(86 + x, 0 + y, weatherClient.getWeatherIcon(0)); } @@ -1312,7 +1315,7 @@ void checkDisplay() { } else if (DISPLAYCLOCK) { if (!printerClient.isOperational() && !isClockOn) { Serial.println("Clock Mode is turned on."); - if (!DISPLAYWEATHER) { + if (!DISPLAYWEATHER && !NEWS_ENABLED) { ui.disableAutoTransition(); ui.setFrames(clockFrame, 1); clockFrame[0] = drawClock; @@ -1372,4 +1375,4 @@ void enableDisplay(boolean enable) { Serial.println("Display was turned OFF: " + timeClient.getFormattedTime()); displayOffEpoch = lastEpoch; } -} +}