From 44722534b91db5fb21f035c26627c098f8c03a96 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Mon, 5 Feb 2024 14:44:42 +0100 Subject: [PATCH 01/41] Strong Typs for colorposition --- include/EEPROMAnything.h | 3 +++ include/Uhr.h | 1 + include/led.h | 8 ++++---- include/led.hpp | 8 ++++---- include/webPageAdapter.h | 2 +- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/EEPROMAnything.h b/include/EEPROMAnything.h index b2d2aa4a..016f5958 100644 --- a/include/EEPROMAnything.h +++ b/include/EEPROMAnything.h @@ -45,6 +45,9 @@ void read() { Serial.printf("BgCol.H : %f\n", G.color[Background].H); Serial.printf("BgCol.S : %f\n", G.color[Background].S); Serial.printf("BgCol.V : %f\n", G.color[Background].B); + Serial.printf("FrCol.H : %f\n", G.color[Frame].H); + Serial.printf("FrCol.S : %f\n", G.color[Frame].S); + Serial.printf("FrCol.V : %f\n", G.color[Frame].B); Serial.printf("Zeitserver: %s\n", G.timeserver); Serial.printf("Lauftext : %s\n", G.scrollingText); Serial.printf("H6 : %u\n", G.h6); diff --git a/include/Uhr.h b/include/Uhr.h index e15ccecd..a9493db0 100644 --- a/include/Uhr.h +++ b/include/Uhr.h @@ -164,6 +164,7 @@ bool externalRTC = false; enum ColorPosition { Foreground = 0, Background = 1, + Frame = 2, }; enum LedColorVariants { diff --git a/include/led.h b/include/led.h index 5f4ae944..34d72699 100644 --- a/include/led.h +++ b/include/led.h @@ -44,7 +44,7 @@ class Led { float setBrightnessAuto(float val); void getCurrentManualBrightnessSetting(uint8_t ¤tBrightness); void getColorbyPositionWithAppliedBrightness(HsbColor &color, - uint8_t position); + ColorPosition position); void shiftColumnToRight(); //------------------------------------------------------------------------------ @@ -52,10 +52,10 @@ class Led { //------------------------------------------------------------------------------ void setPixel(uint16_t ledIndex, HsbColor color); void setPixel(uint8_t row, uint8_t col, HsbColor color); - void setbyFrontMatrix(uint8_t ColorPosition = Foreground, + void setbyFrontMatrix(ColorPosition position = Foreground, bool applyMirrorAndReverse = true); - void setbyMinuteArray(uint8_t ColorPosition = Foreground); - void setbySecondArray(uint8_t ColorPosition = Foreground); + void setbyMinuteArray(ColorPosition position = Foreground); + void setbySecondArray(ColorPosition panic = Foreground); void setIcon(uint8_t iconNum); void setSingle(uint8_t wait); void setPixelForChar(uint8_t col, uint8_t row, uint8_t offsetCol, diff --git a/include/led.hpp b/include/led.hpp index 40f021d9..e48bd873 100644 --- a/include/led.hpp +++ b/include/led.hpp @@ -151,8 +151,8 @@ void Led::getCurrentManualBrightnessSetting(uint8_t ¤tBrightness) { //------------------------------------------------------------------------------ void Led::getColorbyPositionWithAppliedBrightness(HsbColor &color, - uint8_t colorPosition) { - color = G.color[colorPosition]; + ColorPosition position) { + color = G.color[position]; uint8_t manBrightnessSetting = 100; getCurrentManualBrightnessSetting(manBrightnessSetting); @@ -246,7 +246,7 @@ void Led::setbyFrontMatrix(uint8_t colorPosition, bool applyMirrorAndReverse) { //------------------------------------------------------------------------------ -void Led::setbyMinuteArray(uint8_t colorPosition) { +void Led::setbyMinuteArray(ColorPosition colorPosition) { HsbColor displayedColor; getColorbyPositionWithAppliedBrightness(displayedColor, colorPosition); @@ -261,7 +261,7 @@ void Led::setbyMinuteArray(uint8_t colorPosition) { //------------------------------------------------------------------------------ -void Led::setbySecondArray(uint8_t colorPosition) { +void Led::setbySecondArray(ColorPosition colorPosition) { HsbColor displayedColor; getColorbyPositionWithAppliedBrightness(displayedColor, colorPosition); diff --git a/include/webPageAdapter.h b/include/webPageAdapter.h index 89846554..125af4c2 100644 --- a/include/webPageAdapter.h +++ b/include/webPageAdapter.h @@ -150,7 +150,7 @@ bool compareEffBriAndSpeedToOld(uint8_t *payload) { //------------------------------------------------------------------------------ -void parseColor(uint8_t *payload, uint8_t position = Foreground) { +void parseColor(uint8_t *payload, ColorPosition position = Foreground) { if (position == Background) { G.color[position] = {HsbColor(split(payload, 12) / 360.f, split(payload, 15) / 100.f, From 1c3f8dcbbc883261de3fad2bc33ae888f49d4f77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 09:46:53 +0000 Subject: [PATCH 02/41] Bump i18next from 23.8.1 to 23.10.0 Bumps [i18next](https://github.com/i18next/i18next) from 23.8.1 to 23.10.0. - [Release notes](https://github.com/i18next/i18next/releases) - [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next/compare/v23.8.1...v23.10.0) --- updated-dependencies: - dependency-name: i18next dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc6dc048..5aed3148 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "BSD-3-Clause", "dependencies": { "@jaames/iro": "^5.5.2", - "i18next": "^23.8.1", + "i18next": "^23.10.0", "i18next-browser-languagedetector": "^7.2.0", "minified": "^1.0.1", "purecss": "^3.0.0" @@ -2367,9 +2367,9 @@ } }, "node_modules/i18next": { - "version": "23.8.1", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.8.1.tgz", - "integrity": "sha512-Yhe6oiJhigSh64ev7nVVywu7vHjuUG41MRmFKNwphbkadqTL1ozZFBQISflY7/ju+gL6I/SPfI1GgWQh1yYArA==", + "version": "23.10.0", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.10.0.tgz", + "integrity": "sha512-/TgHOqsa7/9abUKJjdPeydoyDc0oTi/7u9F8lMSj6ufg4cbC1Oj3f/Jja7zj7WRIhEQKB7Q4eN6y68I9RDxxGQ==", "funding": [ { "type": "individual", @@ -5769,9 +5769,9 @@ } }, "i18next": { - "version": "23.8.1", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.8.1.tgz", - "integrity": "sha512-Yhe6oiJhigSh64ev7nVVywu7vHjuUG41MRmFKNwphbkadqTL1ozZFBQISflY7/ju+gL6I/SPfI1GgWQh1yYArA==", + "version": "23.10.0", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.10.0.tgz", + "integrity": "sha512-/TgHOqsa7/9abUKJjdPeydoyDc0oTi/7u9F8lMSj6ufg4cbC1Oj3f/Jja7zj7WRIhEQKB7Q4eN6y68I9RDxxGQ==", "requires": { "@babel/runtime": "^7.23.2" } diff --git a/package.json b/package.json index 0a3cbdc8..2b259f57 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ }, "dependencies": { "@jaames/iro": "^5.5.2", - "i18next": "^23.8.1", + "i18next": "^23.10.0", "i18next-browser-languagedetector": "^7.2.0", "minified": "^1.0.1", "purecss": "^3.0.0" From 517f5c0c9e3c72ea888242e6a6494409cb91a462 Mon Sep 17 00:00:00 2001 From: Joakim Selander Date: Sun, 25 Feb 2024 14:23:19 +0100 Subject: [PATCH 03/41] Added Swedish layout --- include/Uhr.h | 1 + include/Uhrtypes/SE10x11.hpp | 156 +++++++++++++++++++++++++++++++++++ include/Uhrtypes/Uhrtype.hpp | 2 +- include/clockWork.hpp | 3 + include/config.h | 8 ++ webpage/index.html | 1 + webpage/language/de.js | 1 + webpage/language/en.js | 1 + webpage/language/es.js | 1 + webpage/language/hu.js | 1 + webpage/language/it.js | 1 + webpage/language/nl.js | 1 + 12 files changed, 176 insertions(+), 1 deletion(-) create mode 100644 include/Uhrtypes/SE10x11.hpp diff --git a/include/Uhr.h b/include/Uhr.h index e15ccecd..cac9b48e 100644 --- a/include/Uhr.h +++ b/include/Uhr.h @@ -270,6 +270,7 @@ enum ClockType { Ch10x11 = 18, Ro10x11 = 19, Fr10x11 = 21, + Se10x11 = 22, }; enum Icons { diff --git a/include/Uhrtypes/SE10x11.hpp b/include/Uhrtypes/SE10x11.hpp new file mode 100644 index 00000000..9eacc52c --- /dev/null +++ b/include/Uhrtypes/SE10x11.hpp @@ -0,0 +1,156 @@ +#pragma once + +#include "Uhrtype.hpp" + +/* + * Layout Front + * COL + * X 9 8 7 6 5 4 3 2 1 0 + * ROW + - - - - - - - - - - - + * 0 | K L O C K A N T Ä R K + * 1 | F E M Y I S T I O N I + * 2 | K V A R T Q I E N Z O + * 3 | T J U G O L I V I P M + * 4 | Ö V E R K A M H A L V + * 5 | E T T U S V L X T V Å + * 6 | T R E M Y K Y F Y R A + * 7 | F E M S F L O R S E X + * 8 | S J U Å T T A I N I O + * 9 | T I O E L V A T O L V + */ + +class Se10x11_t : public iUhrType { +public: + virtual LanguageAbbreviation usedLang() override { + return LanguageAbbreviation::SE; + }; + + //------------------------------------------------------------------------------ + + virtual const bool hasZwanzig() override { return true; } + + //------------------------------------------------------------------------------ + + void show(FrontWord word) override { + switch (word) { + + case FrontWord::es_ist: + // Klockan är + setFrontMatrixWord(0, 6, 10); + setFrontMatrixWord(0, 1, 2); + break; + + case FrontWord::hour_1: + // Ett + setFrontMatrixWord(5, 8, 10); + break; + + case FrontWord::hour_2: + // Två + setFrontMatrixWord(6, 0, 2); + break; + + case FrontWord::hour_3: + // Tre + setFrontMatrixWord(6, 8, 10); + break; + + case FrontWord::hour_4: + // Fyra + setFrontMatrixWord(6, 0, 3); + break; + + case FrontWord::hour_5: + // Fem + setFrontMatrixWord(7, 8, 10); + break; + + case FrontWord::hour_6: + // Sex + setFrontMatrixWord(7, 0, 2); + break; + + case FrontWord::hour_7: + // Sju + setFrontMatrixWord(8, 8, 10); + break; + + case FrontWord::hour_8: + // Åtta + setFrontMatrixWord(8, 4, 7); + break; + + case FrontWord::hour_9: + // Nio + setFrontMatrixWord(8, 0, 2); + break; + + case FrontWord::hour_10: + // Tio + setFrontMatrixWord(9, 8, 10); + break; + + case FrontWord::hour_11: + // Elva + setFrontMatrixWord(9, 4, 7); + break; + + case FrontWord::hour_12: + // Tolv + setFrontMatrixWord(8, 0, 3); + break; + + case FrontWord::min_5: + // Fem + setFrontMatrixWord(1, 8, 10); + break; + + case FrontWord::min_10: + // Tio + setFrontMatrixWord(2, 2, 4); + break; + + case FrontWord::viertel: + // Kvart + setFrontMatrixWord(2, 6, 10); + break; + + case FrontWord::min_20: + // Tjugo + setFrontMatrixWord(3, 6, 10); + break; + +/* case FrontWord::min_25: + // Twentyfive + setFrontMatrixWord(2, 1, 10); + break; +*/ + case FrontWord::halb: + // Halv + setFrontMatrixWord(4, 0, 3); + break; + + case FrontWord::nach: + case FrontWord::v_nach: + // Över + setFrontMatrixWord(4, 7, 10); + break; + + case FrontWord::vor: + case FrontWord::v_vor: + // I + setFrontMatrixWord(3, 2, 2); + break; +/* + case FrontWord::uhr: + // O'Clock ska denna vara med? + setFrontMatrixWord(9, 0, 5); + break; + */ + default: + break; + }; + }; +}; + +Se10x11_t _se10x11; \ No newline at end of file diff --git a/include/Uhrtypes/Uhrtype.hpp b/include/Uhrtypes/Uhrtype.hpp index f97d7b06..1bc1188b 100644 --- a/include/Uhrtypes/Uhrtype.hpp +++ b/include/Uhrtypes/Uhrtype.hpp @@ -1,6 +1,6 @@ #pragma once -enum class LanguageAbbreviation { DE, EN, ES, IT, NL, HU, RO, FR }; +enum class LanguageAbbreviation { DE, EN, ES, IT, NL, HU, RO, FR , SE}; enum class FrontWord { error, diff --git a/include/clockWork.hpp b/include/clockWork.hpp index d5e50e73..86ac2e99 100644 --- a/include/clockWork.hpp +++ b/include/clockWork.hpp @@ -6,6 +6,7 @@ #include "openwmap.h" #include + OpenWMap weather; //------------------------------------------------------------------------------ @@ -82,6 +83,8 @@ iUhrType *ClockWork::getPointer(uint8_t type) { return &_de10x11schwaebisch; case Fr10x11: return &_fr10x11; + case Se10x11: + return &_se10x11; default: return nullptr; } diff --git a/include/config.h b/include/config.h index aa64444a..bf7e0559 100644 --- a/include/config.h +++ b/include/config.h @@ -124,6 +124,14 @@ // 10 rows, 11 LED's per row + 4 LED's for minutes, with modified // layout for the French language +/**********************/ +/* Swedish */ +/**********************/ +// +// #define DEFAULT_LAYOUT Se10x11 +// 10 rows, 11 LED's per row + 4 LED's for minutes, with modified +// layout for the Swedish language + //-------------------------------------------------------------------------- // Define LED Type //-------------------------------------------------------------------------- diff --git a/webpage/index.html b/webpage/index.html index 1ec3b271..cdfb6b3d 100644 --- a/webpage/index.html +++ b/webpage/index.html @@ -244,6 +244,7 @@

+
diff --git a/webpage/language/de.js b/webpage/language/de.js index bc075f2b..efd11b61 100644 --- a/webpage/language/de.js +++ b/webpage/language/de.js @@ -112,6 +112,7 @@ let TRANSLATION_DE_DE = { "ch-10-11": "🇨🇭 10 x 11", "ro-10-11": "🇷🇴 10 x 11", "fr-10-11": "🇫🇷 10 x 11", + "se-10-11": "🇸🇪 10 × 11", "invert-min-dir": "Minutenzählrichtung invertieren", "mirror-vertically": "Wortuhr vertikal spiegeln", "mirror-horizontally": "Wortuhr horizontal spiegeln", diff --git a/webpage/language/en.js b/webpage/language/en.js index e6cbe060..fc45585c 100644 --- a/webpage/language/en.js +++ b/webpage/language/en.js @@ -112,6 +112,7 @@ let TRANSLATION_EN_US = { "ch-10-11": "🇨🇭 10 x 11", "ro-10-11": "🇷🇴 10 x 11", "fr-10-11": "🇫🇷 10 x 11", + "se-10-11": "🇸🇪 10 × 11", "invert-min-dir": "Invert Minute Counting Direction", "mirror-vertically": "Mirror Word Clock Vertically", "mirror-horizontally": "Mirror Word Clock Horizontally", diff --git a/webpage/language/es.js b/webpage/language/es.js index 5d28f83c..a486beb3 100644 --- a/webpage/language/es.js +++ b/webpage/language/es.js @@ -112,6 +112,7 @@ let TRANSLATION_ES = { "ch-10-11": "🇨🇭 10 x 11", "ro-10-11": "🇷🇴 10 x 11", "fr-10-11": "🇫🇷 10 x 11", + "se-10-11": "🇸🇪 10 × 11", "invert-min-dir": "Invertir la dirección de conteo de minutos", "mirror-vertically": "Voltear el reloj verticalmente", "mirror-horizontally": "Voltear el reloj horizontalmente", diff --git a/webpage/language/hu.js b/webpage/language/hu.js index e42edef2..0028b770 100644 --- a/webpage/language/hu.js +++ b/webpage/language/hu.js @@ -109,6 +109,7 @@ let TRANSLATION_HU = { "es-10-11": "🇪🇸 10 × 11", "it-10-11": "🇮🇹 10 × 11", "hu-10-10": "🇭🇺 10 x 10", + "se-10-11": "🇸🇪 10 × 11", "invert-min-dir": "Percszámláló-irány megfordítása", "mirror-vertically": "Szövegóra függőleges tükrözése", "mirror-horizontally": "Szövegóra vízszintes tükrözése", diff --git a/webpage/language/it.js b/webpage/language/it.js index caf934f4..40ddb616 100644 --- a/webpage/language/it.js +++ b/webpage/language/it.js @@ -112,6 +112,7 @@ let TRANSLATION_IT = { "ch-10-11": "🇨🇭 10 x 11", "ro-10-11": "🇷🇴 10 x 11", "fr-10-11": "🇫🇷 10 x 11", + "se-10-11": "🇸🇪 10 × 11", "invert-min-dir": "Invertire la direzione del conteggio dei minuti", "mirror-vertically": "Capovolgi l'orologio verticalmente", "mirror-horizontally": "Capovolgi l'orologio orizzontalmente", diff --git a/webpage/language/nl.js b/webpage/language/nl.js index 606661b9..dbcf274b 100644 --- a/webpage/language/nl.js +++ b/webpage/language/nl.js @@ -112,6 +112,7 @@ let TRANSLATION_NL = { "ch-10-11": "🇨🇭 10 x 11", "ro-10-11": "🇷🇴 10 x 11", "fr-10-11": "🇫🇷 10 x 11", + "se-10-11": "🇸🇪 10 × 11", "invert-min-dir": "Draai minuutrichting om", "mirror-vertically": "Spiegel Woordklok verticaal", "mirror-horizontally": "Spiegel Woordklok horizontaal", From c67f92495d24923538cd52dd1edb5b75fdf31ff7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 09:37:01 +0000 Subject: [PATCH 04/41] Bump terser from 5.27.0 to 5.28.1 Bumps [terser](https://github.com/terser/terser) from 5.27.0 to 5.28.1. - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/compare/v5.27.0...v5.28.1) --- updated-dependencies: - dependency-name: terser dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc6dc048..9d580904 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "grunt-htmllint": "^0.3.0", "grunt-terser": "^2.0.0", "grunt-version": "^3.0.1", - "terser": "^5.27.0" + "terser": "^5.28.1" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -3658,9 +3658,9 @@ "dev": true }, "node_modules/terser": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", - "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", + "version": "5.28.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.28.1.tgz", + "integrity": "sha512-wM+bZp54v/E9eRRGXb5ZFDvinrJIOaTapx3WUokyVGZu5ucVCK55zEgGd5Dl2fSr3jUo5sDiERErUWLY6QPFyA==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -6736,9 +6736,9 @@ "dev": true }, "terser": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", - "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", + "version": "5.28.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.28.1.tgz", + "integrity": "sha512-wM+bZp54v/E9eRRGXb5ZFDvinrJIOaTapx3WUokyVGZu5ucVCK55zEgGd5Dl2fSr3jUo5sDiERErUWLY6QPFyA==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.3", diff --git a/package.json b/package.json index 0a3cbdc8..4bfdd53e 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "grunt-htmllint": "^0.3.0", "grunt-terser": "^2.0.0", "grunt-version": "^3.0.1", - "terser": "^5.27.0" + "terser": "^5.28.1" }, "dependencies": { "@jaames/iro": "^5.5.2", From 0499cea278e26d6b0e4ac5f03ce6201b03100a07 Mon Sep 17 00:00:00 2001 From: Joakim Selander Date: Tue, 27 Feb 2024 20:20:58 +0100 Subject: [PATCH 05/41] Fix numbers --- include/Uhrtypes/SE10x11.hpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/include/Uhrtypes/SE10x11.hpp b/include/Uhrtypes/SE10x11.hpp index 9eacc52c..bca266c0 100644 --- a/include/Uhrtypes/SE10x11.hpp +++ b/include/Uhrtypes/SE10x11.hpp @@ -19,6 +19,7 @@ * 9 | T I O E L V A T O L V */ + class Se10x11_t : public iUhrType { public: virtual LanguageAbbreviation usedLang() override { @@ -36,7 +37,7 @@ class Se10x11_t : public iUhrType { case FrontWord::es_ist: // Klockan är - setFrontMatrixWord(0, 6, 10); + setFrontMatrixWord(0, 4, 10); setFrontMatrixWord(0, 1, 2); break; @@ -47,7 +48,7 @@ class Se10x11_t : public iUhrType { case FrontWord::hour_2: // Två - setFrontMatrixWord(6, 0, 2); + setFrontMatrixWord(5, 0, 2); break; case FrontWord::hour_3: @@ -97,7 +98,7 @@ class Se10x11_t : public iUhrType { case FrontWord::hour_12: // Tolv - setFrontMatrixWord(8, 0, 3); + setFrontMatrixWord(9, 0, 3); break; case FrontWord::min_5: @@ -107,7 +108,7 @@ class Se10x11_t : public iUhrType { case FrontWord::min_10: // Tio - setFrontMatrixWord(2, 2, 4); + setFrontMatrixWord(1, 2, 4); break; case FrontWord::viertel: @@ -120,11 +121,6 @@ class Se10x11_t : public iUhrType { setFrontMatrixWord(3, 6, 10); break; -/* case FrontWord::min_25: - // Twentyfive - setFrontMatrixWord(2, 1, 10); - break; -*/ case FrontWord::halb: // Halv setFrontMatrixWord(4, 0, 3); @@ -141,12 +137,7 @@ class Se10x11_t : public iUhrType { // I setFrontMatrixWord(3, 2, 2); break; -/* - case FrontWord::uhr: - // O'Clock ska denna vara med? - setFrontMatrixWord(9, 0, 5); - break; - */ + default: break; }; From e5ac6b6b36aa9a26d10ad8b64aa693466cdd2ec6 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sat, 2 Mar 2024 16:02:09 +0100 Subject: [PATCH 06/41] Some changes which aren t uploaded before --- include/led.h | 2 +- include/led.hpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/led.h b/include/led.h index 34d72699..d284a5aa 100644 --- a/include/led.h +++ b/include/led.h @@ -55,7 +55,7 @@ class Led { void setbyFrontMatrix(ColorPosition position = Foreground, bool applyMirrorAndReverse = true); void setbyMinuteArray(ColorPosition position = Foreground); - void setbySecondArray(ColorPosition panic = Foreground); + void setbySecondArray(ColorPosition position = Foreground); void setIcon(uint8_t iconNum); void setSingle(uint8_t wait); void setPixelForChar(uint8_t col, uint8_t row, uint8_t offsetCol, diff --git a/include/led.hpp b/include/led.hpp index e48bd873..375dcb3d 100644 --- a/include/led.hpp +++ b/include/led.hpp @@ -220,8 +220,7 @@ void Led::setPixel(uint8_t row, uint8_t col, HsbColor color) { //------------------------------------------------------------------------------ -void Led::setbyFrontMatrix(uint8_t colorPosition, bool applyMirrorAndReverse) { - +void Led::setbyFrontMatrix(ColorPosition colorPosition, bool applyMirrorAndReverse) { if (applyMirrorAndReverse) { applyMirroringAndReverseIfDefined(); } From 421945c2eae2097fba27effd8aa692b8713a4e7e Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sat, 2 Mar 2024 16:04:30 +0100 Subject: [PATCH 07/41] Random transition now works again. Also only every 5 minutes. --- include/Transitiontypes/Transition.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/Transitiontypes/Transition.hpp b/include/Transitiontypes/Transition.hpp index 03d90634..fd88a9ba 100644 --- a/include/Transitiontypes/Transition.hpp +++ b/include/Transitiontypes/Transition.hpp @@ -953,15 +953,15 @@ bool Transition::isOverwrittenByTransition(WordclockChanges changesInWordMatrix, //------------------------------------------------------------------------------ void Transition::loop(struct tm &tm) { - if (matrixChanged) { - matrixChanged = false; - saveMatrix(); - copyMatrix(work, act); - } - if (G.prog == COMMAND_IDLE || G.prog == COMMAND_MODE_WORD_CLOCK) { if (!isSilvester(transitionType, tm, hasMinuteChanged())) { - transitionType = getTransitionType(hasMinuteChanged()); + transitionType = getTransitionType(matrixChanged); + } + + if (matrixChanged) { + matrixChanged = false; + saveMatrix(); + copyMatrix(work, act); } if (transitionType == NO_TRANSITION) { From 78515b58992fa41b9f385cda246d692880ec40e5 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sat, 2 Mar 2024 19:59:05 +0100 Subject: [PATCH 08/41] Clang formatted --- include/led.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/led.hpp b/include/led.hpp index 375dcb3d..ec37377e 100644 --- a/include/led.hpp +++ b/include/led.hpp @@ -220,7 +220,8 @@ void Led::setPixel(uint8_t row, uint8_t col, HsbColor color) { //------------------------------------------------------------------------------ -void Led::setbyFrontMatrix(ColorPosition colorPosition, bool applyMirrorAndReverse) { +void Led::setbyFrontMatrix(ColorPosition colorPosition, + bool applyMirrorAndReverse) { if (applyMirrorAndReverse) { applyMirroringAndReverseIfDefined(); } From 75759bcb2fd2e568f7d035fb9fc2364e5543987f Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sat, 2 Mar 2024 20:19:08 +0100 Subject: [PATCH 09/41] Clang formatted Swedish layout --- include/Uhrtypes/SE10x11.hpp | 19 +++++++++---------- include/Uhrtypes/Uhrtype.hpp | 2 +- include/clockWork.hpp | 1 - 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/include/Uhrtypes/SE10x11.hpp b/include/Uhrtypes/SE10x11.hpp index bca266c0..c292747c 100644 --- a/include/Uhrtypes/SE10x11.hpp +++ b/include/Uhrtypes/SE10x11.hpp @@ -7,19 +7,18 @@ * COL * X 9 8 7 6 5 4 3 2 1 0 * ROW + - - - - - - - - - - - - * 0 | K L O C K A N T Ä R K - * 1 | F E M Y I S T I O N I - * 2 | K V A R T Q I E N Z O - * 3 | T J U G O L I V I P M - * 4 | Ö V E R K A M H A L V - * 5 | E T T U S V L X T V Å - * 6 | T R E M Y K Y F Y R A - * 7 | F E M S F L O R S E X - * 8 | S J U Å T T A I N I O + * 0 | K L O C K A N T Ä R K + * 1 | F E M Y I S T I O N I + * 2 | K V A R T Q I E N Z O + * 3 | T J U G O L I V I P M + * 4 | Ö V E R K A M H A L V + * 5 | E T T U S V L X T V Å + * 6 | T R E M Y K Y F Y R A + * 7 | F E M S F L O R S E X + * 8 | S J U Å T T A I N I O * 9 | T I O E L V A T O L V */ - class Se10x11_t : public iUhrType { public: virtual LanguageAbbreviation usedLang() override { diff --git a/include/Uhrtypes/Uhrtype.hpp b/include/Uhrtypes/Uhrtype.hpp index 1bc1188b..22311b1b 100644 --- a/include/Uhrtypes/Uhrtype.hpp +++ b/include/Uhrtypes/Uhrtype.hpp @@ -1,6 +1,6 @@ #pragma once -enum class LanguageAbbreviation { DE, EN, ES, IT, NL, HU, RO, FR , SE}; +enum class LanguageAbbreviation { DE, EN, ES, IT, NL, HU, RO, FR, SE }; enum class FrontWord { error, diff --git a/include/clockWork.hpp b/include/clockWork.hpp index 86ac2e99..8632b217 100644 --- a/include/clockWork.hpp +++ b/include/clockWork.hpp @@ -6,7 +6,6 @@ #include "openwmap.h" #include - OpenWMap weather; //------------------------------------------------------------------------------ From 8bcd08c664caff1c8e76d89b0c443b73cb4171b0 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 3 Mar 2024 09:53:41 +0100 Subject: [PATCH 10/41] Added Russian language support for Website --- eslintrc.json | 1 + webpage/i18n.js | 3 + webpage/index.html | 3 + webpage/language/de.js | 4 +- webpage/language/en.js | 4 +- webpage/language/es.js | 4 +- webpage/language/hu.js | 4 +- webpage/language/it.js | 4 +- webpage/language/nl.js | 4 +- webpage/language/ru.js | 274 +++++++++++++++++++++++++++++++++++++++++ 10 files changed, 299 insertions(+), 6 deletions(-) mode change 100644 => 100755 eslintrc.json create mode 100755 webpage/language/ru.js diff --git a/eslintrc.json b/eslintrc.json old mode 100644 new mode 100755 index 503ca9ad..869b7e65 --- a/eslintrc.json +++ b/eslintrc.json @@ -268,6 +268,7 @@ "TRANSLATION_IT": "readonly", "TRANSLATION_ES": "readonly", "TRANSLATION_HU": "readonly", + "TRANSLATION_RU": "readonly", "i18next": "readonly", "isLocalEnvironment": "readonly" } diff --git a/webpage/i18n.js b/webpage/i18n.js index 9f8efb04..553155cc 100644 --- a/webpage/i18n.js +++ b/webpage/i18n.js @@ -27,6 +27,9 @@ i18next.init({ }, hu: { translation: TRANSLATION_HU + }, + ru: { + translation: TRANSLATION_RU } } }, (error) => { diff --git a/webpage/index.html b/webpage/index.html index cdfb6b3d..00f60813 100644 --- a/webpage/index.html +++ b/webpage/index.html @@ -65,6 +65,7 @@ + @@ -245,6 +246,7 @@

+
@@ -745,6 +747,7 @@

+ diff --git a/webpage/language/de.js b/webpage/language/de.js index efd11b61..f0f055dc 100644 --- a/webpage/language/de.js +++ b/webpage/language/de.js @@ -11,7 +11,8 @@ let TRANSLATION_DE_DE = { "nl": "🇳🇱 Niederländisch", "es": "🇪🇸 Spanisch", "it": "🇮🇹 Italienisch", - "hu": "🇭🇺 Ungarisch" + "hu": "🇭🇺 Ungarisch", + "ru": "🇷🇺 Russisch" } }, @@ -113,6 +114,7 @@ let TRANSLATION_DE_DE = { "ro-10-11": "🇷🇴 10 x 11", "fr-10-11": "🇫🇷 10 x 11", "se-10-11": "🇸🇪 10 × 11", + "ru-10-11": "🇷🇺 10 × 11", "invert-min-dir": "Minutenzählrichtung invertieren", "mirror-vertically": "Wortuhr vertikal spiegeln", "mirror-horizontally": "Wortuhr horizontal spiegeln", diff --git a/webpage/language/en.js b/webpage/language/en.js index fc45585c..4e6f052e 100644 --- a/webpage/language/en.js +++ b/webpage/language/en.js @@ -11,7 +11,8 @@ let TRANSLATION_EN_US = { "nl": "🇳🇱 Dutch", "es": "🇪🇸 Spanish", "it": "🇮🇹 Italian", - "hu": "🇭🇺 Hungarian" + "hu": "🇭🇺 Hungarian", + "ru": "🇷🇺 Russian" } }, @@ -113,6 +114,7 @@ let TRANSLATION_EN_US = { "ro-10-11": "🇷🇴 10 x 11", "fr-10-11": "🇫🇷 10 x 11", "se-10-11": "🇸🇪 10 × 11", + "ru-10-11": "🇷🇺 10 × 11", "invert-min-dir": "Invert Minute Counting Direction", "mirror-vertically": "Mirror Word Clock Vertically", "mirror-horizontally": "Mirror Word Clock Horizontally", diff --git a/webpage/language/es.js b/webpage/language/es.js index a486beb3..010a73d0 100644 --- a/webpage/language/es.js +++ b/webpage/language/es.js @@ -11,7 +11,8 @@ let TRANSLATION_ES = { "nl": "🇳🇱 Holandés", "es": "🇪🇸 Español", "it": "🇮🇹 Italiano", - "hu": "🇭🇺 Húngaro" + "hu": "🇭🇺 Húngaro", + "ru": "🇷🇺 Ruso" } }, @@ -113,6 +114,7 @@ let TRANSLATION_ES = { "ro-10-11": "🇷🇴 10 x 11", "fr-10-11": "🇫🇷 10 x 11", "se-10-11": "🇸🇪 10 × 11", + "ru-10-11": "🇷🇺 10 × 11", "invert-min-dir": "Invertir la dirección de conteo de minutos", "mirror-vertically": "Voltear el reloj verticalmente", "mirror-horizontally": "Voltear el reloj horizontalmente", diff --git a/webpage/language/hu.js b/webpage/language/hu.js index 0028b770..df70c63b 100644 --- a/webpage/language/hu.js +++ b/webpage/language/hu.js @@ -11,7 +11,8 @@ let TRANSLATION_HU = { "nl": "🇳🇱 Holland", "es": "🇪🇸 Spanyol", "it": "🇮🇹 Olasz", - "hu": "🇭🇺 Magyar" + "hu": "🇭🇺 Magyar", + "ru": "🇷🇺 Orosz" } }, @@ -110,6 +111,7 @@ let TRANSLATION_HU = { "it-10-11": "🇮🇹 10 × 11", "hu-10-10": "🇭🇺 10 x 10", "se-10-11": "🇸🇪 10 × 11", + "ru-10-11": "🇷🇺 10 × 11", "invert-min-dir": "Percszámláló-irány megfordítása", "mirror-vertically": "Szövegóra függőleges tükrözése", "mirror-horizontally": "Szövegóra vízszintes tükrözése", diff --git a/webpage/language/it.js b/webpage/language/it.js index 40ddb616..6fed5c57 100644 --- a/webpage/language/it.js +++ b/webpage/language/it.js @@ -11,7 +11,8 @@ let TRANSLATION_IT = { "nl": "🇳🇱 Olandese", "es": "🇪🇸 Spagnolo", "it": "🇮🇹 Italiano", - "hu": "🇭🇺 Ungherese" + "hu": "🇭🇺 Ungherese", + "ru": "🇷🇺 Russo" } }, @@ -113,6 +114,7 @@ let TRANSLATION_IT = { "ro-10-11": "🇷🇴 10 x 11", "fr-10-11": "🇫🇷 10 x 11", "se-10-11": "🇸🇪 10 × 11", + "ru-10-11": "🇷🇺 10 × 11", "invert-min-dir": "Invertire la direzione del conteggio dei minuti", "mirror-vertically": "Capovolgi l'orologio verticalmente", "mirror-horizontally": "Capovolgi l'orologio orizzontalmente", diff --git a/webpage/language/nl.js b/webpage/language/nl.js index dbcf274b..a462fb81 100644 --- a/webpage/language/nl.js +++ b/webpage/language/nl.js @@ -11,7 +11,8 @@ let TRANSLATION_NL = { "nl": "🇳🇱 Nederlands", "es": "🇪🇸 Spaans", "it": "🇮🇹 Italiaans", - "hu": "🇭🇺 Hongaars" + "hu": "🇭🇺 Hongaars", + "ru": "🇷🇺 Russisch" } }, @@ -113,6 +114,7 @@ let TRANSLATION_NL = { "ro-10-11": "🇷🇴 10 x 11", "fr-10-11": "🇫🇷 10 x 11", "se-10-11": "🇸🇪 10 × 11", + "ru-10-11": "🇷🇺 10 × 11", "invert-min-dir": "Draai minuutrichting om", "mirror-vertically": "Spiegel Woordklok verticaal", "mirror-horizontally": "Spiegel Woordklok horizontaal", diff --git a/webpage/language/ru.js b/webpage/language/ru.js new file mode 100755 index 00000000..d8320cd0 --- /dev/null +++ b/webpage/language/ru.js @@ -0,0 +1,274 @@ +let TRANSLATION_RU = { + "title": "Словесные часы by Ragman", + + "menu": { + "aria-show-menu": "Покажи мне меню", + "aria-hide-menu": "Скрыть меню", + "language": { + "label": "Язык", + "de": "🇩🇪 Немецкий", + "en": "🇬🇧 Английский", + "nl": "🇳🇱 Голландский", + "es": "🇪🇸 Испанский", + "it": "🇮🇹 Итальянский", + "hu": "🇭🇺 Венгерский", + "ru": "🇷🇺 Pусский" + } + }, + + "connection-lost": { + "button": "Соединять", + "text": "Потерялась связь с часами." + }, + + "colors": { + "h1": "Цвета", + "with-background": "С цветом фона" + }, + + "functions": { + "h1": "Характеристики", + "mode": { + "h2": "Режим", + "wordclock": "Словесные часы", + "color": "Цвет", + "seconds": "Секунды", + "digital-clock": "Цифровые часы", + "scrollingtext": "Бегущий текст", + "rainbow": "Радуга", + "color-change": "Изменение цвета", + "symbol": "Символ" + }, + "animation": { + "h2": "Анимация", + "type": { + "label": "Тип" + }, + "duration": { + "label": "Временные рамки", + "short": "короткий", + "medium": "половина", + "long": "длинный" + }, + "color": { + "label": "Анимация в цветах", + "off": "Bыключен", + "words": "Красочные слова", + "letters": "Красочные буквы" + }, + "speed": { + "label": "Скорость" + }, + "demo": { + "label": "Демо" + } + }, + "settings": { + "h2": "Настройки", + "brightness": "Светиться ", + "scrollingtext": "Бегущий текст", + "save": "сохранять", + "speed": "Скорость ", + "leds": "Количество светодиодов ", + "position": "Позиция " + } + }, + + "view": { + "h1": "Параметры экрана", + "front": { + "h2": "Front", + "text": "Изменения размера массива применяются только при сбросе часов.", + "variant": "Выбор варианта часов", + "de-10-11": "🇩🇪 10 × 11", + "de-10-11-alt": "🇩🇪 10 × 11 Альтернатива", + "de-10-11-alt-frame": "🇩🇪 10 × 11 Альтернативная рама", + "de-10-11-vertical": "🇩🇪 10 × 11 Вертикальный", + "de-10-11-clock": "🇩🇪 10 × 11 Часы", + "de-10-11-nero": "🇩🇪 10 × 11 Nero", + "de-10-11-schwaebisch": "🇩🇪 10 × 11 Швабия", + "de-11-11": "🇩🇪 11 × 11", + "de-11-11-v2": "🇩🇪 11 × 11 V2", + "de-11-11-v3": "🇩🇪 11 × 11 (panbachi)", + "de-22-11-weather": "🇩🇪 10 × 11 Погода", + "de-16-8": "🇩🇪 16 × 8", + "de-16-18": "🇩🇪 16 × 18", + "en-10-11": "🇬🇧 10 × 11", + "nl-10-11": "🇳🇱 10 × 11", + "es-10-11": "🇪🇸 10 × 11", + "it-10-11": "🇮🇹 10 × 11", + "hu-10-10": "🇭🇺 10 x 10", + "ch-10-11": "🇨🇭 10 x 11", + "ro-10-11": "🇷🇴 10 x 11", + "fr-10-11": "🇫🇷 10 x 11", + "se-10-11": "🇸🇪 10 × 11", + "ru-10-11": "🇷🇺 10 × 11", + "invert-min-dir": "Обратное направление отсчета минут", + "mirror-vertically": "Переверните часы вертикально", + "mirror-horizontally": "Переверните часы горизонтально", + "buildtype": "Тип конструкции", + "normal": "Каждый светодиод соответствует букве", + "doubleResM1": "Каждый второй светодиод соответствует букве", + "doubleRes": "Два светодиода на букву" + }, + "language": { + "h2": "Язык", + "hide-it-is": "„ЧАС, ЧАСA, ЧАСОВ“ скрывать", + "at-nine-fifteen": "ЧАСОВ 9:15 ...", + "quarter-past-nine": "четверть десятого", + "quarter-nine": "четверть десяти", + "at-nine-twenty": "ЧАСОВ 9:20 ...", + "twenty-past-nine": "девять и двадцать", + "at-nine-fourty": "ЧАСОВ 9:40 ...", + "twenty-before-ten": "от двадцати до десяти", + "at-nine-fourtyfive-german": "ЧАСОВ 9:45 ...", + "quarter-to-ten": "восемь сорок пять", + "three-quarter-ten": "Три четверти десять", + "quarter-to-ten-english": "без четверти десять", + "a-quarter-to-ten-english": "без четверти десять" + }, + "minutes": { + "h2": "минуты", + "mode": "Режим визуализации по минутам", + "off": "Bыключен", + "normal-4-leds": "Нормальный (4 LEDs)", + "normal-7-leds": "Нормальный (7 LEDs)", + "edges": "Углы", + "in-words": "В словах" + }, + "seconds": { + "h2": "Секунды", + "in-border": "Секунды отображаются в рамке.", + "off": "Bыключен", + "point": "Место", + "sector": "Сектор", + "revolving-sector": "Оборотный сектор" + }, + "boot": { + "h2": "Начинать", + "help": "Что должно произойти при перезагрузке?", + "blink-leds": "Пусть светодиоды кратковременно мигнут", + "iterate-leds": "Пусть все светодиоды пройдут один раз", + "wifi-symbol": "Показывать значок Wi-Fi во время поиска сети", + "ip-address": "Показать IP-адрес" + } + }, + + "settings": { + "h1": "Настройки", + "status": { + "h2": "Состояние", + "label": "Статус подключения", + "connect": "Соединять" + }, + "led-type": { + "h2": "Тип светодиода", + "help": "Здесь можно настроить тип используемой светодиодной ленты (WS2812 или SK6812).\n" + + "В зависимости от производителя используемых полосок SK2812 существует другая версия, в которой цвета отображаются в разном порядке.\n" + + "Соответственно, здесь можно задать правильную цветовую схему полосы.\n" + + "G-зеленый/B-синий/R-красный/W-белый", + "label": "Изменение цветотипа", + "ws2812-brg": "WS2812 BRG", + "ws2812-grb": "WS2812 GRB", + "ws2812-rgb": "WS2812 RGB", + "ws2812-rbg": "WS2812 RBG", + "sk6812-brgw": "SK6812 RGBW", + "save": "Сохранить настройки" + }, + "whitetype": { + "h2": "Тип белого светодиода", + "in-border": "Настройка типа белого светодиода полосы RGBW", + "ww": "теплый белый", + "nw": "Нейтральный белый", + "cw": "Холодный белый" + }, + "time-server": { + "h2": "сервер времени", + "label": "сервер времени", + "save": "Сохранить настройки" + }, + "manual-time": { + "h2": "Установите время вручную", + "time": "Время", + "save": "Сохранить настройки" + }, + "brightness": { + "h2": "Светиться", + "mode": "Режим", + "automatic": "Автоматически", + "manual": "Вручную", + "p100": "100 %", + "p80": "80 %", + "p60": "60 %", + "p40": "40 %", + "p20": "20 %", + "off": "Aus", + "zero-to-six": "0:00 – 5:59", + "six-to-eight": "6:00 – 7:59", + "eight-to-twelve": "8:00 – 11:59", + "twelve-to-sixteen": "12:00 – 15:59", + "sixteen-to-eighteen": "16:00 – 17:59", + "eighteen-to-twenty": "18:00 – 19:59", + "twenty-to-twenty-two": "20:00 – 21:59", + "twenty-two-to-zero": "22:00 – 23:59", + "ldr-value": "Текущая яркость фоторезистора (LDR)", + "value-bright": "Значение «Яркое» (0 – 255)", + "value-dark": "«Темное» значение (0 – 255)" + }, + "hostname": { + "h2": "Имя хоста", + "label": "Имя хоста", + "save": "Guardar ajustes" + }, + "weather": { + "h2": "Климат", + "api-key": "OpenWeatherMap API-Ключ", + "city-id": "OpenWeatherMap Город-ID", + "save": "Сохранить настройки" + }, + "wifi": { + "h2": "WiFi / WLAN", + "help": "Реконфигурация создает вашу собственную WLAN.\n" + + "Подключитесь к этому, и тогда можно будет выбрать сеть назначения.", + "ssid": "Имя WLAN (SSID)", + "other-wifi": "Другой Wi-Fi", + "configure": "Настраивать", + "until-restart": "До перезагрузки", + "deactivate": "Выключить" + }, + "restart": { + "h2": "Перезапуск", + "reset": "Начать заново", + "restart": "Сброс к настройкам по умолчанию" + } + }, + + "smart-home": { + "h1": "Умный дом", + "mqtt": { + "h2": "MQTT", + "text": "Программное обеспечение Word Clock предлагает возможность управления через интерфейс MQTT. Вы можете интегрировать часы в существующую систему домашнего помощника, чтобы иметь возможность управлять элементарными функциями. Эта функция все еще является экспериментальной и постоянно расширяется.", + "activate": "Включить MQTT", + "server": "Адрес сервера", + "port": "Порт", + "username": "Имя пользователя", + "password": "Пароль", + "client-id": "ID клиента", + "topic": "Tema", + "save": "Сохранить настройки", + "discovery": "Отправить HA Discovery" + } + }, + + "about": { + "h1": "О", + "text-general": "Программное обеспечение этих часов основано на часах из Ульрих Радиг (Стенд 2019) и я теперь от сообщества продолжим разработку GitHub.", + "text-update": "Можно выполнить обновление ПО, сделайте это. Перейти на страницу обновления.", + "text-license": "Этот проект имеет открытый исходный код и распространяется по 3-пунктной лицензии BSD..", + "software": "Библиотеки и программное обеспечение", + "debug": "Отладочный вывод" + }, + "footer": { + "version": "Версия" + } +}; From 292868f1445dbd2d3c94be8d9aac8a79fbae07c2 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 3 Mar 2024 09:54:59 +0100 Subject: [PATCH 11/41] Refinements for Hungarian .hpp file --- include/Uhrtypes/HU10x10.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Uhrtypes/HU10x10.hpp b/include/Uhrtypes/HU10x10.hpp index 32731853..2335d37c 100644 --- a/include/Uhrtypes/HU10x10.hpp +++ b/include/Uhrtypes/HU10x10.hpp @@ -5,8 +5,8 @@ /* * Layout Front * COL - * X 9 8 7 6 5 4 3 2 1 0 - * ROW + - - - - - - - - - - - + * 9 8 7 6 5 4 3 2 1 0 + * ROW + - - - - - - - - - - * 0 | Ö T B T Í Z J A S U * 1 | P E R C C E L E W O * 2 | M Ú L T A M Ú L V A From 8900795f694d7ef534a9d58a36ebe0e136a962e2 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 3 Mar 2024 09:55:46 +0100 Subject: [PATCH 12/41] No colored Words as default --- src/Wortuhr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Wortuhr.cpp b/src/Wortuhr.cpp index 045c70eb..cdead559 100644 --- a/src/Wortuhr.cpp +++ b/src/Wortuhr.cpp @@ -210,7 +210,7 @@ void setup() { G.transitionType = 0; // Transition::NO_TRANSITION; G.transitionDuration = 2; G.transitionSpeed = 30; - G.transitionColorize = 1; + G.transitionColorize = 0; G.transitionDemo = false; eeprom::write(); From ac692a6145d6c535efff72c67a8b2aa418a3c99a Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 3 Mar 2024 10:09:17 +0100 Subject: [PATCH 13/41] Added Russian Front Language. Thanks to Stefan for the Code --- include/Uhr.h | 1 + include/Uhrtypes/RU10x11.hpp | 227 +++++++++++++++++++++++++++++++++++ include/Uhrtypes/Uhrtype.hpp | 9 +- include/config.h | 8 ++ 4 files changed, 244 insertions(+), 1 deletion(-) create mode 100755 include/Uhrtypes/RU10x11.hpp diff --git a/include/Uhr.h b/include/Uhr.h index 22311ad6..82955ad6 100644 --- a/include/Uhr.h +++ b/include/Uhr.h @@ -272,6 +272,7 @@ enum ClockType { Ro10x11 = 19, Fr10x11 = 21, Se10x11 = 22, + Ru10x11 = 23, }; enum Icons { diff --git a/include/Uhrtypes/RU10x11.hpp b/include/Uhrtypes/RU10x11.hpp new file mode 100755 index 00000000..868486f5 --- /dev/null +++ b/include/Uhrtypes/RU10x11.hpp @@ -0,0 +1,227 @@ +#pragma once + +#include "Uhrtype.hpp" + +/* + * Layout Front by Ragman + * COL + * X 9 8 7 6 5 4 3 2 1 0 + * ROW + - - - - - - - - - - - + * 0 | О Д И Н П Я Т Ь Д В А + * 1 | Д Е Ш Е С Т Ь В Я Т Ь + * 2 | В О Ч Е C E M Ь Т Р И + * 3 | Т Ы Д В Е Р Е С Я Т Ь + * 4 | Н А Д Ц А Т Ь Ч А С А + * 5 | Ч А С О В Д С О Р О К + * 6 | Т Р И Д В А Д П Я Т Ь + * 7 | П Я Т Н А Д Е Ц А Т Ь + * 8 | A M Д Е С Я Т С Я Т Ь + * 9 | П Я Т Ь Я Р М И Н У Т + */ + +class Ru10x11_t : public iUhrType { +public: + virtual LanguageAbbreviation usedLang() override { + return LanguageAbbreviation::RU; + }; + + //------------------------------------------------------------------------------ + + virtual const bool hasZwanzig() override { return true; } + + //------------------------------------------------------------------------------ + + virtual const bool hasTwentyfive() override { return true; } + + //------------------------------------------------------------------------------ + + virtual const bool hasThirtyfive() override { return true; } + + //------------------------------------------------------------------------------ + + virtual const bool hasForty() override { return true; } + + //------------------------------------------------------------------------------ + + virtual const bool hasDreiviertel() override { return true; } + + //------------------------------------------------------------------------------ + + virtual const bool hasFifty() override { return true; } + + //------------------------------------------------------------------------------ + + virtual const bool hasFiftyFive() override { return true; } + + //------------------------------------------------------------------------------ + + void show(FrontWord word) override { + switch (word) { + + case FrontWord::es_ist: + // Ч А С О В (5 ... 12) + setFrontMatrixWord(5, 6, 10); + break; + + case FrontWord::es_ist___plural___: + // Ч А С A (2 ...4) + setFrontMatrixWord(4, 0, 3); + break; + + case FrontWord::es_ist__singular__: + // Ч А С (1) + setFrontMatrixWord(4, 1, 3); + break; + + case FrontWord::hour_1: + // О Д И Н + setFrontMatrixWord(0, 7, 10); + break; + + case FrontWord::hour_2: + // Д В А + setFrontMatrixWord(0, 0, 2); + break; + + case FrontWord::hour_3: + // Т Р И + setFrontMatrixWord(2, 0, 2); + break; + + case FrontWord::hour_4: + // Ч Е Т Ы Р Е + setFrontMatrixWord(2, 7, 8); + setFrontMatrixWord(3, 9, 10); + setFrontMatrixWord(3, 4, 5); + break; + + case FrontWord::hour_5: + // П Я Т Ь + setFrontMatrixWord(0, 3, 6); + break; + + case FrontWord::hour_6: + // Ш Е С Т Ь + setFrontMatrixWord(1, 4, 8); + break; + + case FrontWord::hour_7: + // C E M Ь + setFrontMatrixWord(2, 3, 6); + break; + + case FrontWord::hour_8: + // B O C E M Ь + setFrontMatrixWord(2, 9, 10); + setFrontMatrixWord(2, 3, 6); + break; + + case FrontWord::hour_9: + // Д Е В Я Т Ь + setFrontMatrixWord(1, 9, 10); + setFrontMatrixWord(1, 0, 3); + break; + + case FrontWord::hour_10: + // Д Е С Я Т Ь + setFrontMatrixWord(1, 9, 10); + setFrontMatrixWord(3, 0, 3); + break; + + case FrontWord::hour_11: + // О Д И Н Н А Д Ц А Т Ь + setFrontMatrixWord(0, 7, 10); + setFrontMatrixWord(4, 4, 10); + break; + + case FrontWord::hour_12: + // Д В Е Н А Д Ц А Т Ь + setFrontMatrixWord(3, 6, 8); + setFrontMatrixWord(4, 4, 10); + break; + + case FrontWord::min_5: + // П Я Т Ь М И Н У Т + setFrontMatrixWord(9, 7, 10); + setFrontMatrixWord(9, 0, 4); + break; + + case FrontWord::min_10: + // Д Е С Я Т Ь М И Н У Т + setFrontMatrixWord(8, 7, 8); + setFrontMatrixWord(8, 0, 3); + setFrontMatrixWord(9, 0, 4); + break; + + case FrontWord::viertel: + // П Я Т Н А Д Ц А Т Ь М И Н У Т + setFrontMatrixWord(7, 5, 10); + setFrontMatrixWord(7, 0, 3); + setFrontMatrixWord(9, 0, 4); + break; + + case FrontWord::min_20: + // Д В А Д Ц А Т Ь М И Н У Т + setFrontMatrixWord(6, 4, 7); + setFrontMatrixWord(7, 0, 3); + setFrontMatrixWord(9, 0, 4); + break; + + case FrontWord::min_25: + // Д В А Д Ц А Т Ь П Я Т Ь М И Н У Т + setFrontMatrixWord(6, 4, 7); + setFrontMatrixWord(7, 0, 3); + setFrontMatrixWord(9, 7, 10); + setFrontMatrixWord(9, 0, 4); + break; + + case FrontWord::halb: + // Т Р И Д Ц А Т Ь М И Н У Т + setFrontMatrixWord(6, 7, 10); + setFrontMatrixWord(7, 0, 3); + setFrontMatrixWord(9, 0, 4); + break; + + case FrontWord::min_35: + // Т Р И Д Ц А Т Ь П Я Т Ь М И Н У Т + setFrontMatrixWord(6, 7, 10); + setFrontMatrixWord(7, 0, 3); + setFrontMatrixWord(9, 7, 10); + setFrontMatrixWord(9, 0, 4); + break; + + case FrontWord::min_40: + // C O P O K М И Н У Т + setFrontMatrixWord(5, 0, 4); + setFrontMatrixWord(9, 0, 4); + break; + + case FrontWord::dreiviertel: + // C O P O K П Я Т Ь М И Н У Т + setFrontMatrixWord(5, 0, 4); + setFrontMatrixWord(9, 7, 10); + setFrontMatrixWord(9, 0, 4); + break; + + case FrontWord::min_50: + // П Я Т Ь Д Е С Я Т М И Н У Т + setFrontMatrixWord(6, 0, 3); + setFrontMatrixWord(8, 4, 8); + setFrontMatrixWord(9, 0, 4); + break; + + case FrontWord::min_55: + // П Я Т Ь Д Е С Я Т П Я Т Ь М И Н У Т + setFrontMatrixWord(6, 0, 3); + setFrontMatrixWord(8, 4, 8); + setFrontMatrixWord(9, 7, 10); + setFrontMatrixWord(9, 0, 4); + break; + + default: + break; + }; + }; +}; + +Ru10x11_t _ru10x11; \ No newline at end of file diff --git a/include/Uhrtypes/Uhrtype.hpp b/include/Uhrtypes/Uhrtype.hpp index 22311b1b..98a4840b 100644 --- a/include/Uhrtypes/Uhrtype.hpp +++ b/include/Uhrtypes/Uhrtype.hpp @@ -1,6 +1,6 @@ #pragma once -enum class LanguageAbbreviation { DE, EN, ES, IT, NL, HU, RO, FR, SE }; +enum class LanguageAbbreviation { DE, EN, ES, IT, NL, HU, RO, FR, SE, RU}; enum class FrontWord { error, @@ -69,6 +69,7 @@ enum class FrontWord { m_num4, es_ist, + es_ist__singular__, es_ist___plural___, nach, vor, @@ -181,6 +182,12 @@ class iUhrType { virtual const bool hasThirtyfive() { return false; } + virtual const bool hasForty() { return false; } + + virtual const bool hasFifty() { return false; } + + virtual const bool hasFiftyFive() { return false; } + virtual const bool hasMitternacht() { return false; } virtual const bool has24HourLayout() { return false; } diff --git a/include/config.h b/include/config.h index bf7e0559..b70ea393 100644 --- a/include/config.h +++ b/include/config.h @@ -124,6 +124,14 @@ // 10 rows, 11 LED's per row + 4 LED's for minutes, with modified // layout for the French language +/**********************/ +/* Russian */ +/**********************/ +// +// #define DEFAULT_LAYOUT Ru10x11 +// 10 rows, 11 LED's per row + 4 LED's for minutes, with modified +// layout for the Russian language + /**********************/ /* Swedish */ /**********************/ From 03a58ef4a74f673aa9333c646d18b5b0507edca7 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 3 Mar 2024 10:31:55 +0100 Subject: [PATCH 14/41] Reworked Clockwork for certain languages --- include/clockWork.h | 3 ++ include/clockWork.hpp | 96 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 79 insertions(+), 20 deletions(-) diff --git a/include/clockWork.h b/include/clockWork.h index f7458748..fad9f506 100644 --- a/include/clockWork.h +++ b/include/clockWork.h @@ -31,6 +31,8 @@ class ClockWork { void showMinute(uint8_t min); void resetMinVariantIfNotAvailable(); FrontWord getFrontWordForNum(uint8_t min); + bool hasTwentyAndCheckForUsage(); + bool hasDreiviertelAndCheckForUsage(); void setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour); //------------------------------------------------------------------------------ @@ -46,6 +48,7 @@ class ClockWork { WordclockChanges changesInClockface(); void calcClockface(); void setClock(); + void DetermineWhichItIsToShow(uint8_t offsetHour); void clearClockByProgInit(); public: diff --git a/include/clockWork.hpp b/include/clockWork.hpp index 8632b217..67e58b05 100644 --- a/include/clockWork.hpp +++ b/include/clockWork.hpp @@ -84,6 +84,8 @@ iUhrType *ClockWork::getPointer(uint8_t type) { return &_fr10x11; case Se10x11: return &_se10x11; + case Ru10x11: + return &_ru10x11; default: return nullptr; } @@ -455,6 +457,25 @@ FrontWord ClockWork::getFrontWordForNum(uint8_t min) { //------------------------------------------------------------------------------ +bool ClockWork::hasTwentyAndCheckForUsage() { + return usedUhrType->hasZwanzig() || G.languageVariant[ItIs40]; +} + +//------------------------------------------------------------------------------ + +bool ClockWork::hasDreiviertelAndCheckForUsage() { + if (usedUhrType->hasDreiviertel()) { + if (usedUhrType->usedLang() != LanguageAbbreviation::DE) { + return true; + } else if (G.languageVariant[ItIs45]) { + return true; + } + } + return false; +} + +//------------------------------------------------------------------------------ + void ClockWork::setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour) { if (usedUhrType->has24HourLayout()) { usedUhrType->show(FrontWord::uhr); @@ -505,9 +526,6 @@ void ClockWork::setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour) { case 13: case 14: usedUhrType->show(getFrontWordForNum(min)); - if (usedUhrType->has24HourLayout()) { - usedUhrType->show(FrontWord::minuten); - } usedUhrType->show(FrontWord::nach); break; case 15: // quarter past @@ -530,15 +548,15 @@ void ClockWork::setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour) { usedUhrType->show(getFrontWordForNum(min)); usedUhrType->show(FrontWord::nach); break; - case 20: // 20 past - if (!usedUhrType->hasZwanzig() || G.languageVariant[ItIs20]) { + case 20: + if (hasTwentyAndCheckForUsage()) { + usedUhrType->show(FrontWord::min_20); + usedUhrType->show(FrontWord::nach); + } else { usedUhrType->show(FrontWord::min_10); usedUhrType->show(FrontWord::vor); usedUhrType->show(FrontWord::halb); offsetHour = 1; - } else { - usedUhrType->show(FrontWord::min_20); - usedUhrType->show(FrontWord::nach); } break; case 21: @@ -577,7 +595,7 @@ void ClockWork::setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour) { usedUhrType->show(FrontWord::halb); usedUhrType->show(FrontWord::nach); } else { - if (G.UhrtypeDef == Fr10x11) { + if (G.UhrtypeDef == Fr10x11 || G.UhrtypeDef == Ru10x11) { usedUhrType->show(FrontWord::halb); } else { usedUhrType->show(FrontWord::halb); @@ -602,13 +620,12 @@ void ClockWork::setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour) { } else if (usedUhrType->hasTwentyfive()) { usedUhrType->show(FrontWord::min_25); usedUhrType->show(FrontWord::vor); - offsetHour = 1; } else { usedUhrType->show(FrontWord::min_5); usedUhrType->show(FrontWord::nach); usedUhrType->show(FrontWord::halb); - offsetHour = 1; } + offsetHour = 1; break; case 36: case 37: @@ -620,13 +637,15 @@ void ClockWork::setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour) { offsetHour = 1; break; case 40: - if (!usedUhrType->hasZwanzig() || G.languageVariant[ItIs40]) { + if (usedUhrType->hasForty()) { + usedUhrType->show(FrontWord::min_40); + } else if (hasTwentyAndCheckForUsage()) { + usedUhrType->show(FrontWord::min_20); + usedUhrType->show(FrontWord::vor); + } else { usedUhrType->show(FrontWord::min_10); usedUhrType->show(FrontWord::nach); usedUhrType->show(FrontWord::halb); - } else { - usedUhrType->show(FrontWord::min_20); - usedUhrType->show(FrontWord::vor); } offsetHour = 1; break; @@ -639,7 +658,7 @@ void ClockWork::setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour) { offsetHour = 1; break; case 45: // quarter to - if (usedUhrType->hasDreiviertel() && G.languageVariant[ItIs45]) { + if (hasDreiviertelAndCheckForUsage()) { usedUhrType->show(FrontWord::dreiviertel); } else { // A Quarter to @@ -656,13 +675,25 @@ void ClockWork::setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour) { case 48: case 49: case 50: + if (usedUhrType->hasFifty()) { + usedUhrType->show(FrontWord::min_50); + } else { + usedUhrType->show(getFrontWordForNum(60 - min)); + usedUhrType->show(FrontWord::vor); + } + offsetHour = 1; + break; case 51: case 52: case 53: case 54: case 55: - usedUhrType->show(getFrontWordForNum(60 - min)); - usedUhrType->show(FrontWord::vor); + if (usedUhrType->hasFiftyFive()) { + usedUhrType->show(FrontWord::min_55); + } else { + usedUhrType->show(getFrontWordForNum(60 - min)); + usedUhrType->show(FrontWord::vor); + } offsetHour = 1; break; case 56: @@ -682,6 +713,10 @@ void ClockWork::setMinute(uint8_t min, uint8_t &offsetHour, bool &fullHour) { default: break; } + + if (G.UhrtypeDef == Ru10x11) { + offsetHour = 0; + } } } @@ -821,11 +856,32 @@ void ClockWork::setClock() { setHour(_hour + offsetHour, fullHour); if (!G.languageVariant[NotShowItIs]) { - if (G.UhrtypeDef == Es10x11 && (_hour + offsetHour) == 1) { + DetermineWhichItIsToShow(_hour + offsetHour); + } +} + +//------------------------------------------------------------------------------ + +void ClockWork::DetermineWhichItIsToShow(uint8_t hour) { + if (G.UhrtypeDef == Ru10x11) { + hour %= 12; + switch (hour) { + case 1: + usedUhrType->show(FrontWord::es_ist__singular__); + break; + case 2: + case 3: + case 4: usedUhrType->show(FrontWord::es_ist___plural___); - } else { + break; + default: usedUhrType->show(FrontWord::es_ist); + break; } + } else if (G.UhrtypeDef == Es10x11 && hour == 1) { + usedUhrType->show(FrontWord::es_ist___plural___); + } else { + usedUhrType->show(FrontWord::es_ist); } } From ae3ab1dbb9a050fe4bf1c7376cff49bbaccbefce Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 3 Mar 2024 10:35:20 +0100 Subject: [PATCH 15/41] Clang formated and updated Readme --- README.md | 4 ++-- include/Uhrtypes/Uhrtype.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 407eecc8..0a2114e5 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ English description further below. Dies ist ein Projekt für eine mehrsprachige Wortuhr auf Grundlage eines ESP8266-Mikrocontrollers und einer programmierbaren LED-Leiste (WS2812 oder SK6812). Eine Wortuhr ist ein wunderschönes DIY-Projekt für Anfänger, das Technologie und Design kombiniert, um eine funktionale und ästhetisch ansprechende Uhr zu schaffen. Egal, ob Sie ein Anfänger oder ein erfahrener Bastler sind, dieses Projekt ist eine großartige Möglichkeit, Ihre Fähigkeiten unter Beweis zu stellen und etwas wirklich Besonderes zu schaffen. Die Software hat viele Funktionen: -- Mehrsprachig (🇬🇧, 🇩🇪, 🇪🇸, 🇮🇹, 🇳🇱, 🇭🇺) +- Mehrsprachig (🇬🇧, 🇩🇪, 🇪🇸, 🇮🇹, 🇳🇱, 🇭🇺, 🇷🇴, 🇨🇭, 🇷🇺, 🇸🇪, 🇫🇷) - Unterstützung für mehrere Layouts und LED-Abstände - Farbwechsel der Displayfarbe möglich (RGB oder RGBW) - Digitale Uhranzeige @@ -105,7 +105,7 @@ Die einzige Bedingung ist, dass der Copyright-Hinweis des Originalprogramms nich This is a project for a multilingual word clock based on an ESP8266 microcontroller and a programmable LED strip (WS2812 or SK6812). A word clock is a beautiful DIY project for beginners that combines technology and design to create a functional and aesthetically pleasing clock. Whether you're a beginner or an experienced hobbyist, this project is a great way to show off your skills and create something truly special. The software has many features: -- Multilingual (🇬🇧, 🇩🇪, 🇪🇸, 🇮🇹, 🇳🇱, 🇭🇺) +- Multilingual (🇬🇧, 🇩🇪, 🇪🇸, 🇮🇹, 🇳🇱, 🇭🇺, 🇷🇴, 🇨🇭, 🇷🇺, 🇸🇪, 🇫🇷) - Support for multiple layouts and LED spacing - Colour change of the display colour possible (RGB or RGBW) - Digital clock display diff --git a/include/Uhrtypes/Uhrtype.hpp b/include/Uhrtypes/Uhrtype.hpp index 98a4840b..e0fa96f7 100644 --- a/include/Uhrtypes/Uhrtype.hpp +++ b/include/Uhrtypes/Uhrtype.hpp @@ -1,6 +1,6 @@ #pragma once -enum class LanguageAbbreviation { DE, EN, ES, IT, NL, HU, RO, FR, SE, RU}; +enum class LanguageAbbreviation { DE, EN, ES, IT, NL, HU, RO, FR, SE, RU }; enum class FrontWord { error, From ee8c1a2a38346126ff4f198092581b7418c43b2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 09:02:56 +0000 Subject: [PATCH 16/41] Bump terser from 5.28.1 to 5.30.3 Bumps [terser](https://github.com/terser/terser) from 5.28.1 to 5.30.3. - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/compare/v5.28.1...v5.30.3) --- updated-dependencies: - dependency-name: terser dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f0f6257..97386bf5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "grunt-htmllint": "^0.3.0", "grunt-terser": "^2.0.0", "grunt-version": "^3.0.1", - "terser": "^5.28.1" + "terser": "^5.30.3" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -3658,9 +3658,9 @@ "dev": true }, "node_modules/terser": { - "version": "5.28.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.28.1.tgz", - "integrity": "sha512-wM+bZp54v/E9eRRGXb5ZFDvinrJIOaTapx3WUokyVGZu5ucVCK55zEgGd5Dl2fSr3jUo5sDiERErUWLY6QPFyA==", + "version": "5.30.3", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.3.tgz", + "integrity": "sha512-STdUgOUx8rLbMGO9IOwHLpCqolkDITFFQSMYYwKE1N2lY6MVSaeoi10z/EhWxRc6ybqoVmKSkhKYH/XUpl7vSA==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -6736,9 +6736,9 @@ "dev": true }, "terser": { - "version": "5.28.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.28.1.tgz", - "integrity": "sha512-wM+bZp54v/E9eRRGXb5ZFDvinrJIOaTapx3WUokyVGZu5ucVCK55zEgGd5Dl2fSr3jUo5sDiERErUWLY6QPFyA==", + "version": "5.30.3", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.3.tgz", + "integrity": "sha512-STdUgOUx8rLbMGO9IOwHLpCqolkDITFFQSMYYwKE1N2lY6MVSaeoi10z/EhWxRc6ybqoVmKSkhKYH/XUpl7vSA==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.3", diff --git a/package.json b/package.json index ff125e52..d02d4f45 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "grunt-htmllint": "^0.3.0", "grunt-terser": "^2.0.0", "grunt-version": "^3.0.1", - "terser": "^5.28.1" + "terser": "^5.30.3" }, "dependencies": { "@jaames/iro": "^5.5.2", From b1ceb91e775dae8438d13624f8d7fdd3c66cf56d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 09:51:30 +0000 Subject: [PATCH 17/41] Bump i18next from 23.10.0 to 23.11.2 Bumps [i18next](https://github.com/i18next/i18next) from 23.10.0 to 23.11.2. - [Release notes](https://github.com/i18next/i18next/releases) - [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next/compare/v23.10.0...v23.11.2) --- updated-dependencies: - dependency-name: i18next dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f0f6257..2c3495b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "BSD-3-Clause", "dependencies": { "@jaames/iro": "^5.5.2", - "i18next": "^23.10.0", + "i18next": "^23.11.2", "i18next-browser-languagedetector": "^7.2.0", "minified": "^1.0.1", "purecss": "^3.0.0" @@ -2367,9 +2367,9 @@ } }, "node_modules/i18next": { - "version": "23.10.0", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.10.0.tgz", - "integrity": "sha512-/TgHOqsa7/9abUKJjdPeydoyDc0oTi/7u9F8lMSj6ufg4cbC1Oj3f/Jja7zj7WRIhEQKB7Q4eN6y68I9RDxxGQ==", + "version": "23.11.2", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.2.tgz", + "integrity": "sha512-qMBm7+qT8jdpmmDw/kQD16VpmkL9BdL+XNAK5MNbNFaf1iQQq35ZbPrSlqmnNPOSUY4m342+c0t0evinF5l7sA==", "funding": [ { "type": "individual", @@ -5769,9 +5769,9 @@ } }, "i18next": { - "version": "23.10.0", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.10.0.tgz", - "integrity": "sha512-/TgHOqsa7/9abUKJjdPeydoyDc0oTi/7u9F8lMSj6ufg4cbC1Oj3f/Jja7zj7WRIhEQKB7Q4eN6y68I9RDxxGQ==", + "version": "23.11.2", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.2.tgz", + "integrity": "sha512-qMBm7+qT8jdpmmDw/kQD16VpmkL9BdL+XNAK5MNbNFaf1iQQq35ZbPrSlqmnNPOSUY4m342+c0t0evinF5l7sA==", "requires": { "@babel/runtime": "^7.23.2" } diff --git a/package.json b/package.json index ff125e52..964a09f4 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ }, "dependencies": { "@jaames/iro": "^5.5.2", - "i18next": "^23.10.0", + "i18next": "^23.11.2", "i18next-browser-languagedetector": "^7.2.0", "minified": "^1.0.1", "purecss": "^3.0.0" From c871ac37657da0efb3d94555eb8abb3b0fa88117 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Thu, 18 Apr 2024 17:04:28 +0200 Subject: [PATCH 18/41] Added a powercycle based reset to wordclock --- src/Wortuhr.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/Wortuhr.cpp b/src/Wortuhr.cpp index cdead559..685a042d 100644 --- a/src/Wortuhr.cpp +++ b/src/Wortuhr.cpp @@ -65,6 +65,10 @@ Network network; _Static_assert(sizeof(G) <= EEPROM_SIZE, "Datenstruktur G zu gross für reservierten EEPROM Bereich"); +uint16_t powerCycleCountAddr = + EEPROM_SIZE - 1; // Address in EEPROM to store power cycle count +uint16_t powerCycleCount = 0; // Variable to store power cycle count + //------------------------------------------------------------------------------ uint32_t sntp_startup_delay_MS_rfc_not_less_than_60000() { @@ -112,6 +116,17 @@ void time_is_set() { parametersChanged = true; } +//------------------------------------------------------------------------------ + +void incrementPowerCycleCount() { + if (powerCycleCount > 5) { + powerCycleCount = 0; + } + powerCycleCount++; + EEPROM.write(powerCycleCountAddr, powerCycleCount); + EEPROM.commit(); +} + //------------------------------------------------------------------------------ // Start setup() //------------------------------------------------------------------------------ @@ -130,10 +145,24 @@ void setup() { //------------------------------------- // Read / initialize EEPROM //------------------------------------- - EEPROM.begin(EEPROM_SIZE); + EEPROM.begin(EEPROM_SIZE); eeprom::read(); + //------------------------------------- + + // Read the power cycle count from EEPROM + powerCycleCount = EEPROM.read(powerCycleCountAddr); + incrementPowerCycleCount(); + Serial.print("Power cycle count: "); + Serial.println(powerCycleCount); + if (powerCycleCount == 5) { + G.sernr++; + Serial.println("Reset to initial values"); + } + + //------------------------------------- + if (G.sernr != SERNR) { for (uint16_t i = 0; i < EEPROM_SIZE; i++) { EEPROM.write(i, i); From 2fc57b3cf1314a81c95437dbb0bf2257c922d02f Mon Sep 17 00:00:00 2001 From: David Panusch Date: Thu, 18 Apr 2024 17:06:34 +0200 Subject: [PATCH 19/41] Updated WifiManager Lib --- platformio.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio.ini b/platformio.ini index 9fa303d4..9f9e618c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -25,6 +25,6 @@ lib_deps = links2004/WebSockets@^2.2.1 adafruit/RTClib@^1.11.2 knolleary/PubSubClient@^2.8.0 - https://github.com/tzapu/WiFiManager.git#88c378f ;2.0.16-rc.2 + https://github.com/tzapu/WiFiManager#v2.0.17 bbx10/DNSServer@^1.1.0 extra_scripts = pre:extra_scripts.py From 81941cd9a639f66d4bf06294983ed3032da062fd Mon Sep 17 00:00:00 2001 From: David Panusch Date: Thu, 18 Apr 2024 17:14:14 +0200 Subject: [PATCH 20/41] Added new icons based on @mrschloemp --- include/Uhr.h | 4 ++++ include/icons.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/include/Uhr.h b/include/Uhr.h index 82955ad6..17f2680a 100644 --- a/include/Uhr.h +++ b/include/Uhr.h @@ -289,4 +289,8 @@ enum Icons { SMILEY = 10, NOTE = 11, SNOW = 12, + MAIL = 13, + BELL = 14, + STOP = 15, + STBY = 16, }; diff --git a/include/icons.h b/include/icons.h index 87291603..8584e21a 100644 --- a/include/icons.h +++ b/include/icons.h @@ -146,4 +146,48 @@ const uint16_t grafik_11x10[][11] PROGMEM = { 0b00110101100, // 7 87: . . 0 0 . 0 . 0 0 . . : 77 0b00110101100, // 8 88: . . 0 0 . 0 . 0 0 . . : 98 0b00000100000}, // 9 109: . . . . . 0 . . . . . : 99 + + {0b00000000000, // 0 MAIL 0: . . . . . . . . . . . : 10 + 0b11111111111, // 1 21: 0 0 0 0 0 0 0 0 0 0 0 : 11 + 0b11000000011, // 2 22: 0 0 . . . . . . . 0 0 : 32 + 0b10100000101, // 3 43: 0 . 0 . . . . . 0 . 0 : 33 + 0b10011111001, // 4 44: 0 . . 0 0 0 0 0 . . 0 : 54 + 0b10000100001, // 5 65: 0 . . . . 0 . . . . 0 : 55 + 0b10000000001, // 6 66: 0 . . . . . . . . . 0 : 76 + 0b10000000001, // 7 87: 0 . . . . . . . . . 0 : 77 + 0b11111111111, // 8 88: 0 0 0 0 0 0 0 0 0 0 0 : 98 + 0b00000000000}, // 9 109: . . . . . . . . . . . : 99 + + {0b00000100000, // 0 BELL 0: . . . . . 0 . . . . . : 10 + 0b00001110000, // 1 21: . . . . 0 0 0 . . . . : 11 + 0b00010001000, // 2 22: . . . 0 . . . 0 . . . : 32 + 0b00100000100, // 3 43: . . 0 . . . . . 0 . . : 33 + 0b00100000100, // 4 44: . . 0 . . . . . 0 . . : 54 + 0b01100000110, // 5 65: . 0 0 . . . . . 0 0 . : 55 + 0b01100000011, // 6 66: 0 0 . . . . . . . 0 0 : 76 + 0b01111111110, // 7 87: . 0 0 0 0 0 0 0 0 0 . : 77 + 0b00001110000, // 8 88: . . . . 0 0 0 . . . . : 98 + 0b00000100000}, // 9 109: . . . . . 0 . . . . . : 99 + + {0b00001110000, // 0 STOP 0: . . . . 0 0 0 . . . . : 10 + 0b00111111100, // 1 21: . . 0 0 0 0 0 0 0 . . : 11 + 0b01110001110, // 2 22: . 0 0 0 . . . 0 0 0 . : 32 + 0b11001010011, // 3 43: 0 0 . . 0 . 0 . . 0 0 : 33 + 0b11000100011, // 4 44: 0 0 . . . 0 . . . 0 0 : 54 + 0b11001010011, // 5 65: 0 0 . . 0 . 0 . . 0 0 : 55 + 0b11010001011, // 6 66: 0 0 . 0 . . . 0 . 0 0 : 76 + 0b01100000110, // 7 87: . 0 0 . . . . . 0 0 . : 77 + 0b00111111100, // 8 88: . . 0 0 0 0 0 0 0 . . : 98 + 0b00001110000}, // 9 109: . . . . 0 0 0 . . . . : 99 + + {0b00001110000, // 0 STBY 0: . . . . 0 0 0 . . . . : 10 + 0b00001110000, // 1 21: . . . . 0 0 0 . . . . : 11 + 0b00111111100, // 2 22: . . 0 0 0 0 0 0 0 . . : 32 + 0b01101110110, // 3 43: . 0 0 . 0 0 0 . 0 0 . : 33 + 0b11001110011, // 4 44: 0 0 . . 0 0 0 . . 0 0 : 54 + 0b11001110011, // 5 65: 0 0 . . 0 0 0 . . 0 0 : 55 + 0b11000000011, // 6 66: 0 0 . . . . . . . 0 0 : 76 + 0b11000000011, // 7 87: 0 0 . . . . . . . 0 0 : 77 + 0b01100000110, // 8 88: . 0 0 . . . . . 0 0 . : 98 + 0b00111111100}, // 9 109: . . 0 0 0 0 0 0 0 . . : 99 }; From 5b0a2e72d35704ca15cc5579604b2d7b3834ff23 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Thu, 18 Apr 2024 23:22:06 +0200 Subject: [PATCH 21/41] Additional Reset for Powercycle Counter --- src/Wortuhr.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Wortuhr.cpp b/src/Wortuhr.cpp index 685a042d..20dad73d 100644 --- a/src/Wortuhr.cpp +++ b/src/Wortuhr.cpp @@ -392,6 +392,14 @@ void setup() { Serial.println("--------------------------------------"); Serial.println(""); + //------------------------------------- + // Reset Powercycle Counter + //------------------------------------- + delay(500); + powerCycleCount = 0; + EEPROM.write(powerCycleCountAddr, powerCycleCount); + EEPROM.commit(); + //------------------------------------- // Setup Done //------------------------------------- From b421e7dd8f5b81cf659edacdc75d29288da3ca10 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 21 Apr 2024 18:54:52 +0200 Subject: [PATCH 22/41] Fix for MinuteLEDs are not updated --- include/clockWork.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/clockWork.hpp b/include/clockWork.hpp index 67e58b05..64350e40 100644 --- a/include/clockWork.hpp +++ b/include/clockWork.hpp @@ -1335,6 +1335,11 @@ void ClockWork::loop(struct tm &tm) { calcClockface(); switch (changesInClockface()) { + case WordclockChanges::Minute: + lastMinuteArray = minuteArray; + memcpy(&lastFrontMatrix, &frontMatrix, sizeof lastFrontMatrix); + led.set(WordclockChanges::Minute); + break; case WordclockChanges::Words: lastMinuteArray = minuteArray; memcpy(&lastFrontMatrix, &frontMatrix, sizeof lastFrontMatrix); From 2e18daacf2a4f4e09b62a9584a8ea980e760c12f Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 21 Apr 2024 18:57:48 +0200 Subject: [PATCH 23/41] Clang formatted Uhr.h --- include/Uhr.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Uhr.h b/include/Uhr.h index 17f2680a..af558b4b 100644 --- a/include/Uhr.h +++ b/include/Uhr.h @@ -290,7 +290,7 @@ enum Icons { NOTE = 11, SNOW = 12, MAIL = 13, - BELL = 14, - STOP = 15, + BELL = 14, + STOP = 15, STBY = 16, }; From d4a1294864396bd61a150a06219f1585c9eed3c6 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 21 Apr 2024 19:06:51 +0200 Subject: [PATCH 24/41] Fixed Black Clock after just saving MQTT Credentials --- include/webPageAdapter.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/webPageAdapter.h b/include/webPageAdapter.h index 125af4c2..e77fa102 100644 --- a/include/webPageAdapter.h +++ b/include/webPageAdapter.h @@ -392,10 +392,13 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, //------------------------------------------------------------------------------ case COMMAND_SET_MQTT: { - if (!G.mqtt.state) { + uint8_t newState = split(payload, 3); + + if (newState && !G.mqtt.state) { G.progInit = true; } - G.mqtt.state = split(payload, 3); + + G.mqtt.state = newState; G.mqtt.port = split(payload, 6, 5); uint8_t index_start = 11; payloadTextHandling(payload, G.mqtt.serverAdress, index_start); From 3e770194b0dcd8796c2b1725c21e1bd72c48fb2e Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 21 Apr 2024 19:15:25 +0200 Subject: [PATCH 25/41] Revised "Split" function in webpageadapter.h --- include/webPageAdapter.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/include/webPageAdapter.h b/include/webPageAdapter.h index e77fa102..e7463233 100644 --- a/include/webPageAdapter.h +++ b/include/webPageAdapter.h @@ -111,13 +111,11 @@ WebPageAdapter webSocket = WebPageAdapter(80); //------------------------------------------------------------------------------ uint16_t split(uint8_t *payload, uint8_t start, uint8_t length = 3) { - char buffer[length]; - uint8_t m = 0; - for (uint16_t k = start; k < (start + length); k++) { - buffer[m] = payload[k]; - m++; + String value; + for (uint16_t k = start; k < start + length; k++) { + value += char(payload[k]); } - return atoi(buffer); + return value.toInt(); } //------------------------------------------------------------------------------ @@ -410,6 +408,12 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, payloadTextHandling(payload, G.mqtt.clientId, index_start); index_start += PAYLOAD_LENGTH; payloadTextHandling(payload, G.mqtt.topic, index_start); + Serial.println("Webpageadapter.h411"); + Serial.println(G.mqtt.serverAdress); + Serial.println(G.mqtt.user); + Serial.println(G.mqtt.password); + Serial.println(G.mqtt.clientId); + Serial.println(G.mqtt.topic); break; } From 85427d710c4ba92fb3edc9faac441ba4b714a4a8 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 21 Apr 2024 19:16:28 +0200 Subject: [PATCH 26/41] Removed Debugging code --- include/webPageAdapter.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/include/webPageAdapter.h b/include/webPageAdapter.h index e7463233..679705e8 100644 --- a/include/webPageAdapter.h +++ b/include/webPageAdapter.h @@ -408,12 +408,6 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, payloadTextHandling(payload, G.mqtt.clientId, index_start); index_start += PAYLOAD_LENGTH; payloadTextHandling(payload, G.mqtt.topic, index_start); - Serial.println("Webpageadapter.h411"); - Serial.println(G.mqtt.serverAdress); - Serial.println(G.mqtt.user); - Serial.println(G.mqtt.password); - Serial.println(G.mqtt.clientId); - Serial.println(G.mqtt.topic); break; } From b49fa09d4bd00f1fe5842e28f11a6a55c096f4d4 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 21 Apr 2024 19:24:38 +0200 Subject: [PATCH 27/41] Refactored functionname --- include/clockWork.hpp | 2 +- include/mqtt.h | 2 +- include/mqtt.hpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/clockWork.hpp b/include/clockWork.hpp index 64350e40..3bbf1493 100644 --- a/include/clockWork.hpp +++ b/include/clockWork.hpp @@ -1174,7 +1174,7 @@ void ClockWork::loop(struct tm &tm) { } delay(100); - if (G.mqtt.state && !mqtt.getConnected()) { + if (G.mqtt.state && !mqtt.isConnected()) { mqtt.reInit(); } diff --git a/include/mqtt.h b/include/mqtt.h index 8cd22c35..3f8e291f 100644 --- a/include/mqtt.h +++ b/include/mqtt.h @@ -17,5 +17,5 @@ class Mqtt { void sendState(); void sendDiscovery(); - bool getConnected(); + bool isConnected(); }; diff --git a/include/mqtt.hpp b/include/mqtt.hpp index d5ac0b26..31db62b3 100644 --- a/include/mqtt.hpp +++ b/include/mqtt.hpp @@ -29,12 +29,12 @@ void Mqtt::reInit() { //------------------------------------------------------------------------------ -bool Mqtt::getConnected() { return mqttClient.connected(); } +bool Mqtt::isConnected() { return mqttClient.connected(); } //------------------------------------------------------------------------------ void Mqtt::loop() { - if (!mqttClient.connected()) { + if (!isConnected()) { reconnect(); } mqttClient.loop(); From b1e3a988f0bb6849a58eacf90dda97d1604a5acb Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 21 Apr 2024 21:58:01 +0200 Subject: [PATCH 28/41] Added anonymus login for MQTT --- include/mqtt.hpp | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/include/mqtt.hpp b/include/mqtt.hpp index 31db62b3..d4792662 100644 --- a/include/mqtt.hpp +++ b/include/mqtt.hpp @@ -11,12 +11,56 @@ extern WiFiClient client; PubSubClient mqttClient(client); +/* Description: + +This function checks if a character array representing an MQTT user is empty. An +MQTT user is considered empty if it contains only null characters ('\0') up to +the specified length. + +Input: + +None +Output: + +true if the MQTT user array is empty. +false if the MQTT user array is not empty. +*/ + +bool checkIfMqttUserIsEmpty() { + for (uint8_t i = 0; i < PAYLOAD_LENGTH; i++) { + if (G.mqtt.user[i] != '\0' && !isSpace(G.mqtt.user[i])) { + return false; // Array is not empty + } + } + return true; // Array is empty +} + //------------------------------------------------------------------------------ +/* Description: + +This function initializes an MQTT client connection on an ESP8266 device using +the PubSubClient library. It sets up the MQTT client with the provided MQTT +server address, port, client ID, and other optional parameters such as user +credentials and topic subscription. + +Input: + +None +Output: + +None +*/ + void Mqtt::init() { mqttClient.setServer(G.mqtt.serverAdress, G.mqtt.port); mqttClient.setCallback(callback); - mqttClient.connect(G.mqtt.clientId, G.mqtt.user, G.mqtt.password); + if (checkIfMqttUserIsEmpty()) { + mqttClient.connect(G.mqtt.clientId); + } else { + mqttClient.connect(G.mqtt.clientId, G.mqtt.user, G.mqtt.password); + } + delay(100); mqttClient.subscribe((std::string(G.mqtt.topic) + "/cmd").c_str()); } From edd0e2bb8a4d8f8cb1879414bea53537870e470f Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 21 Apr 2024 22:09:11 +0200 Subject: [PATCH 29/41] Added descriptions to Mqtt.hpp --- include/mqtt.hpp | 181 ++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 148 insertions(+), 33 deletions(-) diff --git a/include/mqtt.hpp b/include/mqtt.hpp index d4792662..9149d9bd 100644 --- a/include/mqtt.hpp +++ b/include/mqtt.hpp @@ -11,6 +11,8 @@ extern WiFiClient client; PubSubClient mqttClient(client); +//------------------------------------------------------------------------------ + /* Description: This function checks if a character array representing an MQTT user is empty. An @@ -66,6 +68,21 @@ void Mqtt::init() { //------------------------------------------------------------------------------ + +/* Description: + +This function attempts to reconnect the MQTT client to the broker after a loss +of connection. It includes a retry mechanism with a maximum number of retries +and a timeout duration. + +Input: + +None +Output: + +None +*/ + void Mqtt::reInit() { mqttClient.connect(G.mqtt.clientId, G.mqtt.user, G.mqtt.password); reconnect(); @@ -73,10 +90,39 @@ void Mqtt::reInit() { //------------------------------------------------------------------------------ + +/* Description: + +This function checks whether the MQTT client is currently connected to the MQTT +broker. It returns a boolean value indicating the connection status. + +Input: + +None +Output: + +Boolean value: +true if the MQTT client is connected to the broker. +false if the MQTT client is not connected to the broker. + */ + bool Mqtt::isConnected() { return mqttClient.connected(); } //------------------------------------------------------------------------------ + +/* Description: + +This function is responsible for managing the MQTT client's main loop. It checks the MQTT connection status and reinitializes the connection if necessary. Additionally, it invokes the loop() function of the underlying MQTT client library to handle incoming MQTT messages and maintain the connection. + +Input: + +None +Output: + +None +*/ + void Mqtt::loop() { if (!isConnected()) { reconnect(); @@ -86,6 +132,22 @@ void Mqtt::loop() { //------------------------------------------------------------------------------ +/* Description: + +This function handles incoming MQTT messages received from the broker. It parses +the payload as JSON data and updates the device's state and parameters +accordingly. + +Input: + +char *topic: A pointer to a character array containing the topic of the received +message. byte *payload: A pointer to an array of bytes containing the payload of +the received message. unsigned int length: The length of the payload in bytes. +Output: + +None +*/ + void Mqtt::callback(char *topic, byte *payload, unsigned int length) { StaticJsonDocument<512> doc; @@ -100,6 +162,7 @@ void Mqtt::callback(char *topic, byte *payload, unsigned int length) { Serial.println(); msg[length] = '\0'; + // Deserialize JSON DeserializationError error = deserializeJson(doc, msg); if (error) { @@ -108,6 +171,7 @@ void Mqtt::callback(char *topic, byte *payload, unsigned int length) { return; } + // Process received JSON data if (doc.containsKey("state")) { if (!strcmp(doc["state"], "ON")) { G.state = true; @@ -139,10 +203,12 @@ void Mqtt::callback(char *topic, byte *payload, unsigned int length) { } } + // Copy marquee_text if present if (doc.containsKey("marquee_text")) { strcpy(G.scrollingText, doc["marquee_text"]); } + // Update color if present if (doc.containsKey("color")) { G.color[Foreground] = HsbColor(float(doc["color"]["h"]) / 360.f, @@ -150,6 +216,7 @@ void Mqtt::callback(char *topic, byte *payload, unsigned int length) { parametersChanged = true; } + // Update brightness if present if (doc.containsKey("brightness")) { G.color[Foreground] = HsbColor(G.color[Foreground].H, G.color[Foreground].S, @@ -160,6 +227,22 @@ void Mqtt::callback(char *topic, byte *payload, unsigned int length) { //------------------------------------------------------------------------------ +/* Description: + +This function is responsible for publishing the current state of the device to +an MQTT topic. It constructs a JSON message containing information about the +device state, such as the power state (ON or OFF), color settings, and +brightness. The constructed JSON message is then published to the MQTT broker on +a specified topic. + +Input: + +None +Output: + +None +*/ + void Mqtt::sendState() { StaticJsonDocument<200> doc; @@ -181,39 +264,55 @@ void Mqtt::sendState() { void Mqtt::sendDiscovery() { - // MQTT discovery for Home Assistant - // { - // "brightness": true, - // "color_mode": true, - // "supported_color_modes": [ - // "hs" - // ], - // "schema": "json", - // "name": "ESP", - // "device": { - // "identifiers": [ - // "ESPBuro" - // ], - // "name": "ESP", - // "sw_version": "3.3", - // "configuration_url": "http://" - // }, - // "state_topic": "ESPBuro/status", - // "command_topic": "ESPBuro/cmd", - // "unique_id": "", - // "plattform": "mqtt", - // "effect": true, - // "effect_list": [ - // "Wordclock", - // "Seconds", - // "Digitalclock", - // "Scrollingtext", - // "Rainbowcycle", - // "Rainbow", - // "Color", - // "Symbol" - // ] - // } + /* Description: + + This function publishes MQTT discovery messages for Home Assistant, + providing configuration details for a light entity. It constructs a JSON + payload according to Home Assistant's MQTT discovery format and publishes it + to the appropriate topic. + + Input: + + None + Output: + + None + */ + + /* Example MQTT Message + { + "brightness": true, + "color_mode": true, + "supported_color_modes": [ + "hs" + ], + "schema": "json", + "name": "ESP", + "device": { + "identifiers": [ + "ESPBuro" + ], + "name": "ESP", + "sw_version": "3.3", + "configuration_url": "http://" + }, + "state_topic": "ESPBuro/status", + "command_topic": "ESPBuro/cmd", + "unique_id": "", + "plattform": "mqtt", + "effect": true, + "effect_list": [ + "Wordclock", + "Seconds", + "Digitalclock", + "Scrollingtext", + "Rainbowcycle", + "Rainbow", + "Color", + "Symbol" + ] + } + */ StaticJsonDocument<700> root; mqttClient.setBufferSize(700); @@ -261,9 +360,25 @@ void Mqtt::sendDiscovery() { buffer, true); } +//------------------------------------------------------------------------------ //------------------------------------------------------------------------------ +/* Description: + +This function is called upon successful reconnection to the MQTT broker. It +performs post-connection tasks, such as subscribing to specific topics. + +Input: + +None +Output: + +None +*/ + void Mqtt::reconnect() { + // Subscribe to the desired topic mqttClient.subscribe((std::string(G.mqtt.topic) + "/cmd").c_str()); Serial.println("MQTT Connected..."); + delay(100); } From 38cca953d64013359333ea21bf2b927b928acff6 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 21 Apr 2024 22:11:52 +0200 Subject: [PATCH 30/41] Clang formated MQTT.hpp --- include/mqtt.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/include/mqtt.hpp b/include/mqtt.hpp index 9149d9bd..af0673b2 100644 --- a/include/mqtt.hpp +++ b/include/mqtt.hpp @@ -68,7 +68,6 @@ void Mqtt::init() { //------------------------------------------------------------------------------ - /* Description: This function attempts to reconnect the MQTT client to the broker after a loss @@ -90,7 +89,6 @@ void Mqtt::reInit() { //------------------------------------------------------------------------------ - /* Description: This function checks whether the MQTT client is currently connected to the MQTT @@ -110,17 +108,19 @@ bool Mqtt::isConnected() { return mqttClient.connected(); } //------------------------------------------------------------------------------ - /* Description: -This function is responsible for managing the MQTT client's main loop. It checks the MQTT connection status and reinitializes the connection if necessary. Additionally, it invokes the loop() function of the underlying MQTT client library to handle incoming MQTT messages and maintain the connection. +This function is responsible for managing the MQTT client's main loop. It checks +the MQTT connection status and reinitializes the connection if necessary. +Additionally, it invokes the loop() function of the underlying MQTT client +library to handle incoming MQTT messages and maintain the connection. Input: None Output: -None +None */ void Mqtt::loop() { @@ -360,7 +360,6 @@ void Mqtt::sendDiscovery() { buffer, true); } -//------------------------------------------------------------------------------ //------------------------------------------------------------------------------ /* Description: From 0d394b7510eb41aaf3a40dca384f39de7f27bfa0 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Sun, 21 Apr 2024 22:31:02 +0200 Subject: [PATCH 31/41] Enhancement for MQTT callback --- include/mqtt.hpp | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/include/mqtt.hpp b/include/mqtt.hpp index af0673b2..1624bdba 100644 --- a/include/mqtt.hpp +++ b/include/mqtt.hpp @@ -154,12 +154,10 @@ void Mqtt::callback(char *topic, byte *payload, unsigned int length) { Serial.print("Received message ["); Serial.print(topic); Serial.print("] "); + char msg[length + 1]; - for (uint32_t i = 0; i < length; i++) { - Serial.print((char)payload[i]); - msg[i] = (char)payload[i]; - } - Serial.println(); + // Convert payload to a null-terminated string + memcpy(msg, payload, length); msg[length] = '\0'; // Deserialize JSON @@ -173,9 +171,10 @@ void Mqtt::callback(char *topic, byte *payload, unsigned int length) { // Process received JSON data if (doc.containsKey("state")) { - if (!strcmp(doc["state"], "ON")) { + const char *state = doc["state"]; + if (!strcmp(state, "ON")) { G.state = true; - } else if (!strcmp(doc["state"], "OFF")) { + } else if (!strcmp(state, "OFF")) { led.clear(); led.show(); G.state = false; @@ -183,22 +182,23 @@ void Mqtt::callback(char *topic, byte *payload, unsigned int length) { parametersChanged = true; } + const char *effect = doc["effect"]; if (doc.containsKey("effect")) { - if (!strcmp("Wordclock", doc["effect"])) { + if (!strcmp("Wordclock", effect)) { G.prog = COMMAND_MODE_WORD_CLOCK; - } else if (!strcmp("Seconds", doc["effect"])) { + } else if (!strcmp("Seconds", effect)) { G.prog = COMMAND_MODE_SECONDS; - } else if (!strcmp("Digitalclock", doc["effect"])) { + } else if (!strcmp("Digitalclock", effect)) { G.prog = COMMAND_MODE_DIGITAL_CLOCK; - } else if (!strcmp("Scrollingtext", doc["effect"])) { + } else if (!strcmp("Scrollingtext", effect)) { G.prog = COMMAND_MODE_SCROLLINGTEXT; - } else if (!strcmp("Rainbowcycle", doc["effect"])) { + } else if (!strcmp("Rainbowcycle", effect)) { G.prog = COMMAND_MODE_RAINBOWCYCLE; - } else if (!strcmp("Rainbow", doc["effect"])) { + } else if (!strcmp("Rainbow", effect)) { G.prog = COMMAND_MODE_RAINBOW; - } else if (!strcmp("Color", doc["effect"])) { + } else if (!strcmp("Color", effect)) { G.prog = COMMAND_MODE_COLOR; - } else if (!strcmp("Symbol", doc["effect"])) { + } else if (!strcmp("Symbol", effect)) { G.prog = COMMAND_MODE_SYMBOL; } } @@ -209,10 +209,11 @@ void Mqtt::callback(char *topic, byte *payload, unsigned int length) { } // Update color if present - if (doc.containsKey("color")) { + JsonObject color = doc["color"]; + if (!color.isNull()) { G.color[Foreground] = - HsbColor(float(doc["color"]["h"]) / 360.f, - float(doc["color"]["s"]) / 100.f, G.color[Foreground].B); + HsbColor(float(color["h"]) / 360.f, float(color["s"]) / 100.f, + G.color[Foreground].B); parametersChanged = true; } From 94a89d0168a228a35519bf1f25e11441535ece0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 21 Apr 2024 20:37:23 +0000 Subject: [PATCH 32/41] Bump i18next-browser-languagedetector from 7.2.0 to 7.2.1 Bumps [i18next-browser-languagedetector](https://github.com/i18next/i18next-browser-languageDetector) from 7.2.0 to 7.2.1. - [Changelog](https://github.com/i18next/i18next-browser-languageDetector/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next-browser-languageDetector/compare/v7.2.0...v7.2.1) --- updated-dependencies: - dependency-name: i18next-browser-languagedetector dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0ad6ca84..1526875e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@jaames/iro": "^5.5.2", "i18next": "^23.11.2", - "i18next-browser-languagedetector": "^7.2.0", + "i18next-browser-languagedetector": "^7.2.1", "minified": "^1.0.1", "purecss": "^3.0.0" }, @@ -2389,9 +2389,9 @@ } }, "node_modules/i18next-browser-languagedetector": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-7.2.0.tgz", - "integrity": "sha512-U00DbDtFIYD3wkWsr2aVGfXGAj2TgnELzOX9qv8bT0aJtvPV9CRO77h+vgmHFBMe7LAxdwvT/7VkCWGya6L3tA==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-7.2.1.tgz", + "integrity": "sha512-h/pM34bcH6tbz8WgGXcmWauNpQupCGr25XPp9cZwZInR9XHSjIFDYp1SIok7zSPsTOMxdvuLyu86V+g2Kycnfw==", "dependencies": { "@babel/runtime": "^7.23.2" } @@ -5777,9 +5777,9 @@ } }, "i18next-browser-languagedetector": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-7.2.0.tgz", - "integrity": "sha512-U00DbDtFIYD3wkWsr2aVGfXGAj2TgnELzOX9qv8bT0aJtvPV9CRO77h+vgmHFBMe7LAxdwvT/7VkCWGya6L3tA==", + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/i18next-browser-languagedetector/-/i18next-browser-languagedetector-7.2.1.tgz", + "integrity": "sha512-h/pM34bcH6tbz8WgGXcmWauNpQupCGr25XPp9cZwZInR9XHSjIFDYp1SIok7zSPsTOMxdvuLyu86V+g2Kycnfw==", "requires": { "@babel/runtime": "^7.23.2" } diff --git a/package.json b/package.json index 87ef87b9..e03fddd7 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "dependencies": { "@jaames/iro": "^5.5.2", "i18next": "^23.11.2", - "i18next-browser-languagedetector": "^7.2.0", + "i18next-browser-languagedetector": "^7.2.1", "minified": "^1.0.1", "purecss": "^3.0.0" } From bbcf0a400be0060db6083068eedce53b7f61fba0 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Mon, 22 Apr 2024 10:33:48 +0200 Subject: [PATCH 33/41] Clang formated Discription --- include/mqtt.hpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/include/mqtt.hpp b/include/mqtt.hpp index 1624bdba..c2540b60 100644 --- a/include/mqtt.hpp +++ b/include/mqtt.hpp @@ -134,16 +134,16 @@ void Mqtt::loop() { /* Description: -This function handles incoming MQTT messages received from the broker. It parses -the payload as JSON data and updates the device's state and parameters -accordingly. +This function handles incoming MQTT messages received from the broker. It +parses the payload as JSON data and updates the device's state and +parameters accordingly. Input: -char *topic: A pointer to a character array containing the topic of the received -message. byte *payload: A pointer to an array of bytes containing the payload of -the received message. unsigned int length: The length of the payload in bytes. -Output: +char *topic: A pointer to a character array containing the topic of the +received message. byte *payload: A pointer to an array of bytes containing +the payload of the received message. unsigned int length: The length of the +payload in bytes. Output: None */ @@ -230,11 +230,11 @@ void Mqtt::callback(char *topic, byte *payload, unsigned int length) { /* Description: -This function is responsible for publishing the current state of the device to -an MQTT topic. It constructs a JSON message containing information about the -device state, such as the power state (ON or OFF), color settings, and -brightness. The constructed JSON message is then published to the MQTT broker on -a specified topic. +This function is responsible for publishing the current state of the device +to an MQTT topic. It constructs a JSON message containing information about +the device state, such as the power state (ON or OFF), color settings, and +brightness. The constructed JSON message is then published to the MQTT +broker on a specified topic. Input: @@ -269,8 +269,8 @@ void Mqtt::sendDiscovery() { This function publishes MQTT discovery messages for Home Assistant, providing configuration details for a light entity. It constructs a JSON - payload according to Home Assistant's MQTT discovery format and publishes it - to the appropriate topic. + payload according to Home Assistant's MQTT discovery format and + publishes it to the appropriate topic. Input: From 096784d82edd02bcf7b898b432802de94f688ec4 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Mon, 22 Apr 2024 10:35:23 +0200 Subject: [PATCH 34/41] Updated MQTT ReInit --- include/clockWork.hpp | 4 ---- include/mqtt.h | 3 +-- include/mqtt.hpp | 45 +++++++++++++++++++------------------------ 3 files changed, 21 insertions(+), 31 deletions(-) diff --git a/include/clockWork.hpp b/include/clockWork.hpp index 3bbf1493..ddad604a 100644 --- a/include/clockWork.hpp +++ b/include/clockWork.hpp @@ -1174,10 +1174,6 @@ void ClockWork::loop(struct tm &tm) { } delay(100); - if (G.mqtt.state && !mqtt.isConnected()) { - mqtt.reInit(); - } - eeprom::write(); break; } diff --git a/include/mqtt.h b/include/mqtt.h index 3f8e291f..de49ec3a 100644 --- a/include/mqtt.h +++ b/include/mqtt.h @@ -4,7 +4,7 @@ class Mqtt { private: - void reconnect(); + void reInit(); static void callback(char *topic, byte *payload, unsigned int length); public: @@ -12,7 +12,6 @@ class Mqtt { ~Mqtt() = default; void init(); - void reInit(); void loop(); void sendState(); void sendDiscovery(); diff --git a/include/mqtt.hpp b/include/mqtt.hpp index c2540b60..247bd99e 100644 --- a/include/mqtt.hpp +++ b/include/mqtt.hpp @@ -6,6 +6,8 @@ #include #define HOMEASSISTANT_DISCOVERY_TOPIC "homeassistant" +#define RETRY_INTERVALL 10000 // Seconds +#define MAX_RETRIES 50 extern WiFiClient client; @@ -83,8 +85,23 @@ None */ void Mqtt::reInit() { - mqttClient.connect(G.mqtt.clientId, G.mqtt.user, G.mqtt.password); - reconnect(); + static uint8_t retryCount = 0; + static ulong lastRetryTime = 0; + + if (millis() - lastRetryTime >= RETRY_INTERVALL) { + retryCount++; + Serial.print("Reconnecting to MQTT Server. Try "); + Serial.println(retryCount); + lastRetryTime = millis(); + + init(); + + // Check if maximum retries reached + if (retryCount >= MAX_RETRIES) { + Serial.println("Maximum retries reached."); + G.mqtt.state = 0; + } + } } //------------------------------------------------------------------------------ @@ -125,7 +142,7 @@ None void Mqtt::loop() { if (!isConnected()) { - reconnect(); + reInit(); } mqttClient.loop(); } @@ -360,25 +377,3 @@ void Mqtt::sendDiscovery() { .c_str(), buffer, true); } - -//------------------------------------------------------------------------------ - -/* Description: - -This function is called upon successful reconnection to the MQTT broker. It -performs post-connection tasks, such as subscribing to specific topics. - -Input: - -None -Output: - -None -*/ - -void Mqtt::reconnect() { - // Subscribe to the desired topic - mqttClient.subscribe((std::string(G.mqtt.topic) + "/cmd").c_str()); - Serial.println("MQTT Connected..."); - delay(100); -} From 0bbee931b2dbd5b33dc8659767a0408c63effe7e Mon Sep 17 00:00:00 2001 From: David Panusch Date: Tue, 23 Apr 2024 00:22:27 +0200 Subject: [PATCH 35/41] Refined MQTT reconnect --- include/mqtt.hpp | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/include/mqtt.hpp b/include/mqtt.hpp index 247bd99e..65fe2e8c 100644 --- a/include/mqtt.hpp +++ b/include/mqtt.hpp @@ -6,8 +6,11 @@ #include #define HOMEASSISTANT_DISCOVERY_TOPIC "homeassistant" -#define RETRY_INTERVALL 10000 // Seconds -#define MAX_RETRIES 50 + +#define RETRY_INTERVALL_WITHIN_5_MINUTES 15000 // 15 Seconds +#define MAX_RETRIES_WITHIN_5_MINUTES 20 + +#define RETRY_INTERVALL 3600000 // 1 Hour extern WiFiClient client; @@ -64,8 +67,12 @@ void Mqtt::init() { } else { mqttClient.connect(G.mqtt.clientId, G.mqtt.user, G.mqtt.password); } - delay(100); + delay(50); mqttClient.subscribe((std::string(G.mqtt.topic) + "/cmd").c_str()); + delay(50); + if (isConnected()) { + Serial.println("MQTT Connected"); + } } //------------------------------------------------------------------------------ @@ -86,9 +93,10 @@ None void Mqtt::reInit() { static uint8_t retryCount = 0; - static ulong lastRetryTime = 0; + static uint32_t lastRetryTime = 0; + static uint32_t retryIntervall = RETRY_INTERVALL_WITHIN_5_MINUTES; - if (millis() - lastRetryTime >= RETRY_INTERVALL) { + if (millis() - lastRetryTime >= retryIntervall) { retryCount++; Serial.print("Reconnecting to MQTT Server. Try "); Serial.println(retryCount); @@ -97,9 +105,15 @@ void Mqtt::reInit() { init(); // Check if maximum retries reached - if (retryCount >= MAX_RETRIES) { - Serial.println("Maximum retries reached."); - G.mqtt.state = 0; + if (retryCount >= MAX_RETRIES_WITHIN_5_MINUTES) { + Serial.println("Switched to hourly MQTT connect retry"); + retryIntervall = RETRY_INTERVALL; + retryCount = 0; + } + + if (isConnected()) { + retryCount = 0; + retryIntervall = RETRY_INTERVALL_WITHIN_5_MINUTES; } } } From b09eaeaf78186e76a8bba1b2e9fe8b00af6cdb9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 09:32:16 +0000 Subject: [PATCH 36/41] Bump terser from 5.30.3 to 5.30.4 Bumps [terser](https://github.com/terser/terser) from 5.30.3 to 5.30.4. - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/compare/v5.30.3...v5.30.4) --- updated-dependencies: - dependency-name: terser dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1526875e..d75d8038 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "grunt-htmllint": "^0.3.0", "grunt-terser": "^2.0.0", "grunt-version": "^3.0.1", - "terser": "^5.30.3" + "terser": "^5.30.4" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -3658,9 +3658,9 @@ "dev": true }, "node_modules/terser": { - "version": "5.30.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.3.tgz", - "integrity": "sha512-STdUgOUx8rLbMGO9IOwHLpCqolkDITFFQSMYYwKE1N2lY6MVSaeoi10z/EhWxRc6ybqoVmKSkhKYH/XUpl7vSA==", + "version": "5.30.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.4.tgz", + "integrity": "sha512-xRdd0v64a8mFK9bnsKVdoNP9GQIKUAaJPTaqEQDL4w/J8WaW4sWXXoMZ+6SimPkfT5bElreXf8m9HnmPc3E1BQ==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -6736,9 +6736,9 @@ "dev": true }, "terser": { - "version": "5.30.3", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.3.tgz", - "integrity": "sha512-STdUgOUx8rLbMGO9IOwHLpCqolkDITFFQSMYYwKE1N2lY6MVSaeoi10z/EhWxRc6ybqoVmKSkhKYH/XUpl7vSA==", + "version": "5.30.4", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.4.tgz", + "integrity": "sha512-xRdd0v64a8mFK9bnsKVdoNP9GQIKUAaJPTaqEQDL4w/J8WaW4sWXXoMZ+6SimPkfT5bElreXf8m9HnmPc3E1BQ==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.3", diff --git a/package.json b/package.json index e03fddd7..7b32cbcf 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "grunt-htmllint": "^0.3.0", "grunt-terser": "^2.0.0", "grunt-version": "^3.0.1", - "terser": "^5.30.3" + "terser": "^5.30.4" }, "dependencies": { "@jaames/iro": "^5.5.2", From 1aa07c79084023811ee619a04371052fbf938bee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Apr 2024 09:09:54 +0000 Subject: [PATCH 37/41] Bump i18next from 23.11.2 to 23.11.3 Bumps [i18next](https://github.com/i18next/i18next) from 23.11.2 to 23.11.3. - [Release notes](https://github.com/i18next/i18next/releases) - [Changelog](https://github.com/i18next/i18next/blob/master/CHANGELOG.md) - [Commits](https://github.com/i18next/i18next/compare/v23.11.2...v23.11.3) --- updated-dependencies: - dependency-name: i18next dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index d75d8038..6062c8d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "BSD-3-Clause", "dependencies": { "@jaames/iro": "^5.5.2", - "i18next": "^23.11.2", + "i18next": "^23.11.3", "i18next-browser-languagedetector": "^7.2.1", "minified": "^1.0.1", "purecss": "^3.0.0" @@ -2367,9 +2367,9 @@ } }, "node_modules/i18next": { - "version": "23.11.2", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.2.tgz", - "integrity": "sha512-qMBm7+qT8jdpmmDw/kQD16VpmkL9BdL+XNAK5MNbNFaf1iQQq35ZbPrSlqmnNPOSUY4m342+c0t0evinF5l7sA==", + "version": "23.11.3", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.3.tgz", + "integrity": "sha512-Pq/aSKowir7JM0rj+Wa23Kb6KKDUGno/HjG+wRQu0PxoTbpQ4N89MAT0rFGvXmLkRLNMb1BbBOKGozl01dabzg==", "funding": [ { "type": "individual", @@ -5769,9 +5769,9 @@ } }, "i18next": { - "version": "23.11.2", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.2.tgz", - "integrity": "sha512-qMBm7+qT8jdpmmDw/kQD16VpmkL9BdL+XNAK5MNbNFaf1iQQq35ZbPrSlqmnNPOSUY4m342+c0t0evinF5l7sA==", + "version": "23.11.3", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.11.3.tgz", + "integrity": "sha512-Pq/aSKowir7JM0rj+Wa23Kb6KKDUGno/HjG+wRQu0PxoTbpQ4N89MAT0rFGvXmLkRLNMb1BbBOKGozl01dabzg==", "requires": { "@babel/runtime": "^7.23.2" } diff --git a/package.json b/package.json index 7b32cbcf..0c880fe2 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ }, "dependencies": { "@jaames/iro": "^5.5.2", - "i18next": "^23.11.2", + "i18next": "^23.11.3", "i18next-browser-languagedetector": "^7.2.1", "minified": "^1.0.1", "purecss": "^3.0.0" From dbfbdfc27d110074df45f58f609b39e814f925d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Apr 2024 09:06:30 +0000 Subject: [PATCH 38/41] Bump terser from 5.30.4 to 5.31.0 Bumps [terser](https://github.com/terser/terser) from 5.30.4 to 5.31.0. - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/compare/v5.30.4...v5.31.0) --- updated-dependencies: - dependency-name: terser dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index d75d8038..ebd7f2a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "grunt-htmllint": "^0.3.0", "grunt-terser": "^2.0.0", "grunt-version": "^3.0.1", - "terser": "^5.30.4" + "terser": "^5.31.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -3658,9 +3658,9 @@ "dev": true }, "node_modules/terser": { - "version": "5.30.4", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.4.tgz", - "integrity": "sha512-xRdd0v64a8mFK9bnsKVdoNP9GQIKUAaJPTaqEQDL4w/J8WaW4sWXXoMZ+6SimPkfT5bElreXf8m9HnmPc3E1BQ==", + "version": "5.31.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.0.tgz", + "integrity": "sha512-Q1JFAoUKE5IMfI4Z/lkE/E6+SwgzO+x4tq4v1AyBLRj8VSYvRO6A/rQrPg1yud4g0En9EKI1TvFRF2tQFcoUkg==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -6736,9 +6736,9 @@ "dev": true }, "terser": { - "version": "5.30.4", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.30.4.tgz", - "integrity": "sha512-xRdd0v64a8mFK9bnsKVdoNP9GQIKUAaJPTaqEQDL4w/J8WaW4sWXXoMZ+6SimPkfT5bElreXf8m9HnmPc3E1BQ==", + "version": "5.31.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.0.tgz", + "integrity": "sha512-Q1JFAoUKE5IMfI4Z/lkE/E6+SwgzO+x4tq4v1AyBLRj8VSYvRO6A/rQrPg1yud4g0En9EKI1TvFRF2tQFcoUkg==", "dev": true, "requires": { "@jridgewell/source-map": "^0.3.3", diff --git a/package.json b/package.json index 7b32cbcf..a439b7d4 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "grunt-htmllint": "^0.3.0", "grunt-terser": "^2.0.0", "grunt-version": "^3.0.1", - "terser": "^5.30.4" + "terser": "^5.31.0" }, "dependencies": { "@jaames/iro": "^5.5.2", From 1b11e5619b5dcd99fccdd3167607bedf4dda76fb Mon Sep 17 00:00:00 2001 From: David Panusch Date: Thu, 2 May 2024 20:37:03 +0200 Subject: [PATCH 39/41] Fixed static color change --- include/clockWork.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/clockWork.hpp b/include/clockWork.hpp index ddad604a..cd477852 100644 --- a/include/clockWork.hpp +++ b/include/clockWork.hpp @@ -1310,8 +1310,12 @@ void ClockWork::loop(struct tm &tm) { for (uint8_t row = 0; row < usedUhrType->rowsWordMatrix(); row++) { frontMatrix[row] = num32BitWithOnesAccordingToColumns(); } + } + + if (parametersChanged) { led.setbyFrontMatrix(Foreground, false); led.show(); + parametersChanged = false; } break; } From e5996bf50b3023e5a24b74894d47303f94b22e3f Mon Sep 17 00:00:00 2001 From: David Panusch Date: Thu, 2 May 2024 20:37:40 +0200 Subject: [PATCH 40/41] Fixed Static color change Part II --- include/webPageAdapter.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/webPageAdapter.h b/include/webPageAdapter.h index 679705e8..051d0c28 100644 --- a/include/webPageAdapter.h +++ b/include/webPageAdapter.h @@ -270,6 +270,7 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t *payload, G.progInit = true; } + parametersChanged = true; parseColor(payload); break; } From 31be9b5867836c91d4d001358db7e0867656c852 Mon Sep 17 00:00:00 2001 From: David Panusch Date: Thu, 2 May 2024 23:42:10 +0200 Subject: [PATCH 41/41] Fix for sudden brightness change if colortemperature ist changed --- webpage/script.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webpage/script.js b/webpage/script.js index 76c0dccf..6ee1d82b 100644 --- a/webpage/script.js +++ b/webpage/script.js @@ -447,7 +447,11 @@ function initWebsocket() { function changeColor(color) { hsb[color.index][0] = color.hue; hsb[color.index][1] = color.saturation; - hsb[color.index][2] = color.value; + if (color.value !== 100) { + hsb[color.index][2] = color.value; + } + + setColors(); sendColorData(command, nstr(1)); }