diff --git a/include/EEPROMAnything.h b/include/EEPROMAnything.h index 631073cc..bdeee802 100644 --- a/include/EEPROMAnything.h +++ b/include/EEPROMAnything.h @@ -60,8 +60,6 @@ void read() { Serial.printf("H18 : %u\n", G.h18); Serial.printf("H22 : %u\n", G.h22); Serial.printf("H24 : %u\n", G.h24); - Serial.printf("LDR : %u\n", G.ldr); - Serial.printf("LDRCal : %u\n", G.ldrCal); Serial.printf("Uhrtype : %u\n", G.UhrtypeDef); Serial.printf("MQTT_State : %u\n", G.mqtt.state); diff --git a/include/Uhr.h b/include/Uhr.h index 5728a732..0b3e4185 100644 --- a/include/Uhr.h +++ b/include/Uhr.h @@ -110,8 +110,6 @@ struct GLOBAL { char timeserver[PAYLOAD_LENGTH]; char hostname[PAYLOAD_LENGTH]; char scrollingText[PAYLOAD_LENGTH]; - uint16_t ldr; - uint16_t ldrCal; bool state; uint8_t h6; uint8_t h8; @@ -219,12 +217,10 @@ enum CommandWords { COMMAND_SET_LANGUAGE_VARIANT = 84, COMMAND_SET_MQTT = 85, - COMMAND_SET_TIME_MANUAL = 86, - COMMAND_SET_WPS_MODE = 87, + COMMAND_SET_TIME_MANUAL = 86, /* 87 is unused */ COMMAND_SET_COLORTYPE = 88, COMMAND_SET_UHRTYPE = 89, COMMAND_SET_WEATHER_DATA = 90, - COMMAND_SET_LDR = 91, COMMAND_SET_HOSTNAME = 92, COMMAND_SET_SETTING_SECOND = 93, COMMAND_SET_MINUTE = 94, @@ -253,13 +249,12 @@ enum ClockType { Eng10x11 = 10, Ger10x11 = 1, Ger10x11Alternative = 2, - Ger10x11AlternativeFrame = 12, - Ger10x11Vertical = 13, + Ger10x11AlternativeFrame = 4, + Ger10x11Vertical = 12, Ger10x11Clock = 6, Ger10x11Nero = 11, Ger11x11 = 3, Ger11x11V2 = 8, - Ger11x11Frame = 4, Ger22x11Weather = 5, Ger16x18 = 7, Nl10x11 = 9, diff --git a/include/Uhrtypes/DE11x11.frame.hpp b/include/Uhrtypes/DE11x11.frame.hpp deleted file mode 100644 index 376ebe58..00000000 --- a/include/Uhrtypes/DE11x11.frame.hpp +++ /dev/null @@ -1,317 +0,0 @@ -#pragma once - -#include "Uhrtype.hpp" - -/* - * Layout Front - * - * E S K I S T R F Ü N F - * Z E H N Z W A N Z I G - * D R E I V I E R T E L - * T G N A C H V O R U M - * H A L B G Z W Ö L F J - * Z W E I N S I E B E N - * K D R E I R H F Ü N F - * E L F N E U N V I E R - * N A C H T Z E H N B X - * U S E C H S F U E R Y - * W A S D F U N K U H R - * + + + + - */ - -/* - * LED Layout - * - * 0 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 ,10 ,11 ,12 - * 25 ,24 ,23 ,22 ,21 ,20 ,19 ,18 ,17 ,16 ,15 ,14 ,13 - * 26 ,27 ,28 ,29 ,30 ,31 ,32 ,33 ,34 ,35 ,36 ,37 ,38 - * 51 ,50 ,49 ,48 ,47 ,46 ,45 ,44 ,43 ,42 ,41 ,40 ,39 - * 52 ,53 ,54 ,55 ,56 ,57 ,58 ,59 ,60 ,61 ,62 ,63 ,64 - * 77 ,76 ,75 ,74 ,73 ,72 ,71 ,70 ,69 ,68 ,67 ,66 ,65 - * 78 ,79 ,80 ,81 ,82 ,83 ,84 ,85 ,86 ,87 ,88 ,89 ,90 - * 103,102,101,100,99 ,98 ,97 ,96 ,95 ,94 ,93 ,92 ,91 - * 104,105,106,107,108,109,110,111,112,113,114,115,116 - * 129,128,127,126,125,124,123,122,121,120,119,118,117 - * 130,131,132,133,134,135,136,137,138,139,140,141,142 - * 155,154,153,152,151,150,149,148,147,146,145,144,143 - * 156,157,158,159,160,161,162,163,164,165,166,167,168 - */ - -class De11x11frame_t : public iUhrType { -public: - virtual LanguageAbbreviation usedLang() override { - return LanguageAbbreviation::DE; - }; - - //------------------------------------------------------------------------------ - - const uint16_t rmatrix[48] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 38, 39, 64, 65, 90, 91, 116, 117, 142, 143, - 168, 167, 166, 165, 164, 163, 162, 161, 160, 159, 158, 157, - 156, 155, 130, 129, 104, 103, 78, 77, 52, 51, 26, 25}; - - //------------------------------------------------------------------------------ - - virtual const void getMinuteArray(uint16_t *returnArr, uint8_t col) { - const uint8_t corner[4] = {152, 150, 148, 146}; - - for (uint8_t i = 0; i < 4; i++) { - switch (col) { - case 0: - // LEDs for "LED4x" minute display - // {150, 149, 148, 147} - returnArr[i] = 150 - i; - break; - case 1: - // LEDs for "LED7x" minute display - // {152, 150, 148, 146} - returnArr[i] = 152 - (i * 2); - break; - case 2: - // LEDs for "Corners" minute display - // {0, 12, 168, 156} - returnArr[i] = corner[i]; - break; - - default: - break; - } - } - }; - - //------------------------------------------------------------------------------ - - virtual const uint16_t getFrontMatrixIndex(uint8_t row, - uint8_t col) override { - row++; - if (row % 2 != 0) { - col = colsWordMatrix() - col - 1; - } - uint16_t returnValue = col + 1 + (row * colsWordMatrix() + 2); - if (returnValue > numPixels()) { - Serial.println("[ERROR] getMatrix() ReturnValue out of Bounds"); - } - return returnValue; - }; - //------------------------------------------------------------------------------ - - virtual const uint16_t getFrameMatrixIndex(uint16_t index) override { - return rmatrix[index]; - }; - - //------------------------------------------------------------------------------ - - virtual const uint16_t getWordMatrixIndex(uint16_t index) override { - uint8_t row = index / colsWordMatrix(); - uint8_t col = index % colsWordMatrix(); - if (row % 2 == 0) { - col = colsWordMatrix() - 1 - col; - } - return getFrontMatrixIndex(row, col); - }; - - //------------------------------------------------------------------------------ - - virtual const uint16_t numPixels() override { return 169; }; - - //------------------------------------------------------------------------------ - - virtual const uint8_t rowsWordMatrix() override { return 11; }; - - //------------------------------------------------------------------------------ - - virtual const uint16_t numPixelsWordMatrix() override { return 121; }; - - //------------------------------------------------------------------------------ - - virtual const uint8_t numPixelsFrameMatrix() override { return 48; }; - - //------------------------------------------------------------------------------ - - virtual const bool hasSecondsFrame() override { return true; } - - //------------------------------------------------------------------------------ - - void show(FrontWord word) override { - switch (word) { - - case FrontWord::es_ist: - // Es - setFrontMatrixPixel(24); - setFrontMatrixPixel(23); - - // Ist - setFrontMatrixPixel(21); - setFrontMatrixPixel(20); - setFrontMatrixPixel(19); - break; - - case FrontWord::nach: - case FrontWord::v_nach: - setFrontMatrixPixel(55); - setFrontMatrixPixel(56); - setFrontMatrixPixel(57); - setFrontMatrixPixel(58); - break; - - case FrontWord::vor: - case FrontWord::v_vor: - setFrontMatrixPixel(59); - setFrontMatrixPixel(60); - setFrontMatrixPixel(61); - - case FrontWord::viertel: - setFrontMatrixPixel(40); - setFrontMatrixPixel(41); - setFrontMatrixPixel(42); - setFrontMatrixPixel(43); - setFrontMatrixPixel(44); - setFrontMatrixPixel(45); - setFrontMatrixPixel(46); - break; - - case FrontWord::fuenf: - setFrontMatrixPixel(14); - setFrontMatrixPixel(15); - setFrontMatrixPixel(16); - setFrontMatrixPixel(17); - break; - - case FrontWord::zehn: - setFrontMatrixPixel(27); - setFrontMatrixPixel(28); - setFrontMatrixPixel(29); - setFrontMatrixPixel(30); - break; - - case FrontWord::zwanzig: - setFrontMatrixPixel(31); - setFrontMatrixPixel(32); - setFrontMatrixPixel(33); - setFrontMatrixPixel(34); - setFrontMatrixPixel(35); - setFrontMatrixPixel(36); - setFrontMatrixPixel(37); - break; - - case FrontWord::halb: - setFrontMatrixPixel(73); - setFrontMatrixPixel(74); - setFrontMatrixPixel(75); - setFrontMatrixPixel(76); - break; - - case FrontWord::eins: - setFrontMatrixPixel(81); - setFrontMatrixPixel(82); - setFrontMatrixPixel(83); - setFrontMatrixPixel(84); - break; - - case FrontWord::uhr: - setFrontMatrixPixel(146); - setFrontMatrixPixel(145); - setFrontMatrixPixel(144); - break; - - case FrontWord::h_ein: - setFrontMatrixPixel(81); - setFrontMatrixPixel(82); - setFrontMatrixPixel(83); - break; - - case FrontWord::h_zwei: - setFrontMatrixPixel(79); - setFrontMatrixPixel(80); - setFrontMatrixPixel(81); - setFrontMatrixPixel(82); - break; - - case FrontWord::h_drei: - setFrontMatrixPixel(98); - setFrontMatrixPixel(99); - setFrontMatrixPixel(100); - setFrontMatrixPixel(101); - break; - - case FrontWord::h_vier: - setFrontMatrixPixel(112); - setFrontMatrixPixel(113); - setFrontMatrixPixel(114); - setFrontMatrixPixel(115); - break; - - case FrontWord::h_fuenf: - setFrontMatrixPixel(92); - setFrontMatrixPixel(93); - setFrontMatrixPixel(94); - setFrontMatrixPixel(95); - break; - - case FrontWord::h_sechs: - setFrontMatrixPixel(132); - setFrontMatrixPixel(133); - setFrontMatrixPixel(134); - setFrontMatrixPixel(135); - setFrontMatrixPixel(136); - break; - - case FrontWord::h_sieben: - setFrontMatrixPixel(84); - setFrontMatrixPixel(85); - setFrontMatrixPixel(86); - setFrontMatrixPixel(87); - setFrontMatrixPixel(88); - setFrontMatrixPixel(89); - break; - - case FrontWord::h_acht: - setFrontMatrixPixel(124); - setFrontMatrixPixel(125); - setFrontMatrixPixel(126); - setFrontMatrixPixel(127); - break; - - case FrontWord::h_neun: - setFrontMatrixPixel(108); - setFrontMatrixPixel(109); - setFrontMatrixPixel(110); - setFrontMatrixPixel(111); - break; - - case FrontWord::h_zehn: - setFrontMatrixPixel(120); - setFrontMatrixPixel(121); - setFrontMatrixPixel(122); - setFrontMatrixPixel(123); - break; - - case FrontWord::h_elf: - setFrontMatrixPixel(105); - setFrontMatrixPixel(106); - setFrontMatrixPixel(107); - break; - - case FrontWord::h_zwoelf: - setFrontMatrixPixel(67); - setFrontMatrixPixel(68); - setFrontMatrixPixel(69); - setFrontMatrixPixel(70); - setFrontMatrixPixel(71); - break; - - case FrontWord::funk: - setFrontMatrixPixel(150); - setFrontMatrixPixel(149); - setFrontMatrixPixel(148); - setFrontMatrixPixel(147); - break; - - default: - break; - }; - }; -}; - -De11x11frame_t _de11x11frame; \ No newline at end of file diff --git a/include/clockWork.hpp b/include/clockWork.hpp index 77115686..c363ecf8 100644 --- a/include/clockWork.hpp +++ b/include/clockWork.hpp @@ -30,17 +30,6 @@ void ClockWork::loopLdrLogic() { } else { ldrVal = map(lux, G.autoLdrDark, G.autoLdrBright, 10, 100); } - } else { - if (G.ldr == 1) { - lux = lux - (G.ldrCal * 20); - if (lux >= 900) { - lux = 900; - } // Max Brightness - if (lux <= 1) { - lux = 1; - } // Min Brightness - ldrVal = map(lux, 1, 900, 1, 100); - } } if (ldrValOld != ldrVal) { led.set(); @@ -69,8 +58,6 @@ iUhrType *ClockWork::getPointer(uint8_t type) { return &_de11x11; case Ger11x11V2: return &_de11x11V2; - case Ger11x11Frame: - return &_de11x11frame; case Ger22x11Weather: return &_de22x11Weather; case Ger16x18: @@ -783,7 +770,7 @@ void ClockWork::loop(struct tm &tm) { //-------------------------------------------- // LDR Routine //-------------------------------------------- - if ((G.ldr == 1) || G.autoLdrEnabled) { + if (G.autoLdrEnabled) { loopLdrLogic(); } @@ -867,8 +854,6 @@ void ClockWork::loop(struct tm &tm) { config["effectBri"] = G.effectBri; config["secondVariant"] = static_cast(G.secondVariant); config["minuteVariant"] = static_cast(G.minuteVariant); - config["ldr"] = G.ldr; - config["ldrCal"] = G.ldrCal; config["cityid"] = G.openWeatherMap.cityid; config["apikey"] = G.openWeatherMap.apikey; config["colortype"] = G.Colortype; @@ -966,7 +951,6 @@ void ClockWork::loop(struct tm &tm) { case COMMAND_SET_MINUTE: case COMMAND_SET_BRIGHTNESS: - case COMMAND_SET_LDR: case COMMAND_SET_AUTO_LDR: case COMMAND_SET_LANGUAGE_VARIANT: case COMMAND_SET_LAYOUT_VARIANT: diff --git a/include/led.hpp b/include/led.hpp index fcaf313b..14ed5516 100644 --- a/include/led.hpp +++ b/include/led.hpp @@ -105,9 +105,6 @@ void Led::getColorbyPositionWithAppliedBrightness(Color &color, if (G.autoLdrEnabled) { color.hsb.B = setBrightnessAuto(color.hsb.B); color.alpha = setBrightnessAuto(color.alpha); - } else if (G.ldr == 1) { - color.hsb.B *= ldrVal / 100.f; - color.alpha *= ldrVal / 100.f; } else { color.hsb.B *= manBrightnessSetting / 100.f; color.alpha *= manBrightnessSetting / 100.f; diff --git a/include/webPageAdapter.h b/include/webPageAdapter.h index 41fb84aa..fb92ce24 100644 --- a/include/webPageAdapter.h +++ b/include/webPageAdapter.h @@ -352,17 +352,6 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, //------------------------------------------------------------------------------ - case COMMAND_SET_LDR: { - G.conf = COMMAND_SET_LDR; - G.ldr = split(payload, 3); - G.ldrCal = split(payload, 6); - Serial.printf("LDR : %u\n\n", G.ldr); - Serial.printf("LDR Kalibrierung: %u\n\n", G.ldrCal); - break; - } - - //------------------------------------------------------------------------------ - case COMMAND_SET_AUTO_LDR: { G.conf = COMMAND_SET_AUTO_LDR; G.autoLdrEnabled = split(payload, 3); @@ -528,7 +517,6 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, case COMMAND_SET_WIFI_DISABLED: case COMMAND_SET_WIFI_AND_RESTART: - case COMMAND_SET_WPS_MODE: case COMMAND_RESET: { G.conf = command; break; diff --git a/src/Wortuhr.cpp b/src/Wortuhr.cpp index 6321c7b2..90cdd738 100644 --- a/src/Wortuhr.cpp +++ b/src/Wortuhr.cpp @@ -164,8 +164,6 @@ void setup() { #ifdef MINUTE_LED7x G.minuteVariant = MinuteVariant::LED7x; #endif - G.ldr = 0; - G.ldrCal = 0; strcpy(G.openWeatherMap.cityid, ""); strcpy(G.openWeatherMap.apikey, ""); strcpy(G.timeserver, "europe.pool.ntp.org"); diff --git a/webpage/index.html b/webpage/index.html index b54f1ab6..5520c2db 100644 --- a/webpage/index.html +++ b/webpage/index.html @@ -208,13 +208,12 @@

- - - -
- -
- - - -

diff --git a/webpage/language/de.js b/webpage/language/de.js index f356cdca..6c881cb5 100644 --- a/webpage/language/de.js +++ b/webpage/language/de.js @@ -81,7 +81,6 @@ let TRANSLATION_DE_DE = { "de-10-11-nero": "Deutsch 10 × 11 Nero", "de-11-11": "Deutsch 11 × 11", "de-11-11-v2": "Deutsch 11 × 11 Version 2", - "de-11-11-frame": "Deutsch 11 × 11 Rahmen", "de-22-11-weather": "Deutsch 10 × 11 Wetter", "de-16-18": "Deutsch 16 × 18", "en-10-11": "Englisch 10 × 11", @@ -201,12 +200,6 @@ let TRANSLATION_DE_DE = { "city-id": "OpenWeatherMap City-ID", "save": "Einstellung speichern" }, - "ldr": { - "h2": "Fotowiderstand (LDR)", - "activate": "Aktivieren der Fotowiderstand-Steuerung (Legacy)", - "calibration": "Kalibrierung", - "off": "Aus" - }, "wifi": { "h2": "Wi-Fi / WLAN", "help": "Neukonfiguration erstellt ein eigenes WLAN.\n" + diff --git a/webpage/language/en.js b/webpage/language/en.js index 4d6381a5..eca323ec 100644 --- a/webpage/language/en.js +++ b/webpage/language/en.js @@ -81,7 +81,6 @@ let TRANSLATION_EN_US = { "de-10-11-nero": "German 10 × 11 Nero", "de-11-11": "German 11 × 11", "de-11-11-v2": "German 11 × 11 Version 2", - "de-11-11-frame": "German 11 × 11 Frame", "de-22-11-weather": "German 10 × 11 Weather", "de-16-18": "German 16 × 18", "en-10-11": "English 10 × 11", @@ -201,12 +200,6 @@ let TRANSLATION_EN_US = { "city-id": "OpenWeatherMap City ID", "save": "Save Setting" }, - "ldr": { - "h2": "Photoresistor (LDR)", - "activate": "Activate Photoresistor Control (Legacy)", - "calibration": "Calibration", - "off": "Off" - }, "wifi": { "h2": "Wi-Fi", "help": "Reconfiguration creates its own wireless network.\n " + diff --git a/webpage/language/nl.js b/webpage/language/nl.js index 17927b62..39c0d7af 100644 --- a/webpage/language/nl.js +++ b/webpage/language/nl.js @@ -81,7 +81,6 @@ let TRANSLATION_NL = { "de-10-11-nero": "Duits 10 × 11 Nero", "de-11-11": "Duits 11 × 11", "de-11-11-v2": "Duits 11 × 11 Versie 2", - "de-11-11-frame": "Duits 11 × 11 Frame", "de-22-11-weather": "Duits 10 × 11 Weer", "de-16-18": "Duits 16 × 18", "en-10-11": "Engels 10 × 11", @@ -201,12 +200,6 @@ let TRANSLATION_NL = { "city-id": "OpenWeatherMap City ID", "save": "Opslaan" }, - "ldr": { - "h2": "Lichtsensor (LDR)", - "activate": "Activeer lichtsensor", - "calibration": "Kalibratie", - "off": "Uit" - }, "wifi": { "h2": "Wi-Fi", "help": "Herconfiguratie creëert zijn eigen Wi-Fi.\n" + diff --git a/webpage/script.js b/webpage/script.js index ccf77eee..f21f690d 100644 --- a/webpage/script.js +++ b/webpage/script.js @@ -53,8 +53,6 @@ var h22 = 100; var h24 = 100; var dialect = [0, 0, 0, 0, 0, 0]; var layVar = [0, 0, 0]; -var ldr = 0; -var ldrCal = 0; var showSeconds = 0; var showMinutes = 0; var UhrtypeDef = 0; @@ -113,12 +111,10 @@ var COMMAND_SET_INITIAL_VALUES = 20; var COMMAND_SET_TIME = 30; var COMMAND_SET_LANGUAGE_VARIANT = 84; var COMMAND_SET_MQTT = 85; -var COMMAND_SET_TIME_MANUAL = 86; -var COMMAND_SET_WPS_MODE = 87; +var COMMAND_SET_TIME_MANUAL = 86; /* 87 is unused */ var COMMAND_SET_COLORTYPE = 88; var COMMAND_SET_UHRTYPE = 89; var COMMAND_SET_WEATHER_DATA = 90; -var COMMAND_SET_LDR = 91; var COMMAND_SET_HOSTNAME = 92; var COMMAND_SET_SETTING_SECOND = 93; var COMMAND_SET_MINUTE = 94; @@ -132,9 +128,7 @@ var COMMAND_SET_BOOT = 101; var COMMAND_SET_AUTO_LDR = 102; var COMMAND_SET_LAYOUT_VARIANT = 103; -var COMMAND_BRIGHTNESS = 151; var COMMAND_SPEED = 152; -var COMMAND_LEDS = 153; var COMMAND_REQUEST_CONFIG_VALUES = 200; var COMMAND_REQUEST_COLOR_VALUES = 201; @@ -192,8 +186,6 @@ function initConfigValues() { h20 = 100; h22 = 100; h24 = 100; - ldr = 0; - ldrCal = 10; dialect = [0, 0, 0, 0, 0, 0]; layVar = [0, 0, 0]; showSeconds = 0; @@ -351,8 +343,6 @@ function initWebsocket() { document.getElementById("layvar-1").checked = data.layVar1; document.getElementById("layvar-2").checked = data.layVar2; - document.getElementById("ldr").checked = data.ldr; - $("ldr-cal").set("value", data.ldrCal); $("#slider-brightness").set("value", data.effectBri); $("#slider-speed").set("value", data.effectSpeed); // TODO: there is no property effectSpeed! $("#show-seconds").set("value", data.secondVariant); @@ -916,13 +906,6 @@ $.ready(function() { sendCmd(COMMAND_SET_COLORTYPE, nstr(colortype)); debugMessage("Colortype" + debugMessageReconfigured); }); - $("[id*='ldr']").on("change", function() { - ldr = $("#ldr").get("checked") | 0; - ldrCal = $("#ldr-cal").get("value"); - - sendCmd(COMMAND_SET_LDR, nstr(ldr) + nstr(ldrCal)); - debugMessage("LDR mode" + debugMessageReconfigured); - }); $("#hostname-button").on("click", function() { var hostname = $("#hostname").get("value"); @@ -941,9 +924,6 @@ $.ready(function() { $("#disable-button").on("click", function() { sendCmd(COMMAND_SET_WIFI_DISABLED); }); - $("#wps-button").on("click", function() { - sendCmd(COMMAND_SET_WPS_MODE); - }); $("#reset-button").on("click", function() { sendCmd(COMMAND_RESET); });