From 44d48ac5abcd02eb0b6614db4d617fd61bf646a0 Mon Sep 17 00:00:00 2001 From: "Andrew J.Swan" Date: Mon, 2 Dec 2024 23:32:37 +0200 Subject: [PATCH 1/3] 2024.12.1: Removed unused components, corrected version --- components/ehmtxv2/EHMTX.h | 21 ++++++++++----------- components/ehmtxv2/EHMTX_queue.cpp | 28 ++++++++++++++-------------- components/ehmtxv2/__init__.py | 2 +- tests/ulanzi-test.yaml | 6 +++--- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/components/ehmtxv2/EHMTX.h b/components/ehmtxv2/EHMTX.h index 2fda3cd..6135e29 100644 --- a/components/ehmtxv2/EHMTX.h +++ b/components/ehmtxv2/EHMTX.h @@ -1,9 +1,9 @@ #ifndef EHMTX_H #define EHMTX_H #include "esphome.h" -#ifdef EHMTXv2_MULTICOLOR_TEXT -#include -#endif +// #ifdef EHMTXv2_MULTICOLOR_TEXT +// #include +// #endif #define USE_Fireplugin #include "esphome/components/time/real_time_clock.h" @@ -38,7 +38,7 @@ const uint8_t TEXTSCROLLSTART = 8; const uint8_t TEXTSTARTOFFSET = (32 - 8); const uint16_t POLLINGINTERVAL = 250; -static const char *const EHMTX_VERSION = "2024.11.0"; +static const char *const EHMTX_VERSION = "2024.12.1"; static const char *const TAG = "EHMTXv2"; enum show_mode : uint8_t @@ -365,10 +365,9 @@ namespace esphome PROGMEM Color text_color, progressbar_color, progressbar_back_color; PROGMEM std::string text; PROGMEM std::string icon_name; - #ifdef EHMTXv2_MULTICOLOR_TEXT - PROGMEM std::array charcolors; - - #endif + // #ifdef EHMTXv2_MULTICOLOR_TEXT + // PROGMEM std::array charcolors; + // #endif #endif #ifdef USE_ESP8266 Color text_color, progressbar_color, progressbar_back_color; @@ -381,9 +380,9 @@ namespace esphome Color heatColor(uint8_t temperature); void status(); - #ifdef EHMTXv2_MULTICOLOR_TEXT - void multicolor(std::string text,Color c); - #endif + // #ifdef EHMTXv2_MULTICOLOR_TEXT + // void multicolor(std::string text,Color c); + // #endif void draw(); bool isfree(); diff --git a/components/ehmtxv2/EHMTX_queue.cpp b/components/ehmtxv2/EHMTX_queue.cpp index 9356d05..df388b5 100644 --- a/components/ehmtxv2/EHMTX_queue.cpp +++ b/components/ehmtxv2/EHMTX_queue.cpp @@ -86,24 +86,24 @@ namespace esphome #ifdef EHMTXv2_ADV_BITMAP this->bitmap = nullptr; #endif -#ifdef EHMTXv2_MULTICOLOR_TEXT - this->charcolors = {}; -#endif +// #ifdef EHMTXv2_MULTICOLOR_TEXT +// this->charcolors = {}; +// #endif this->progressbar_color = esphome::display::COLOR_OFF; this->progressbar_back_color = esphome::display::COLOR_OFF; } - #ifdef EHMTXv2_MULTICOLOR_TEXT - void EHMTX_queue::multicolor(std::string _text,Color c) - { - std::regex color_re("(#[A-Fa-f0-9]{6})"); - this->text = std::regex_replace(_text, color_re, ""); - - for (std::string::size_type i = 0; i < _text.size(); ++i) { - this->charcolors[i] = c; - } - } - #endif +// #ifdef EHMTXv2_MULTICOLOR_TEXT +// void EHMTX_queue::multicolor(std::string _text,Color c) +// { +// std::regex color_re("(#[A-Fa-f0-9]{6})"); +// this->text = std::regex_replace(_text, color_re, ""); +// +// for (std::string::size_type i = 0; i < _text.size(); ++i) { +// this->charcolors[i] = c; +// } +// } +// #endif void EHMTX_queue::status() { diff --git a/components/ehmtxv2/__init__.py b/components/ehmtxv2/__init__.py index 927fe9c..9403fde 100644 --- a/components/ehmtxv2/__init__.py +++ b/components/ehmtxv2/__init__.py @@ -19,7 +19,7 @@ _LOGGER = logging.getLogger(__name__) DEPENDENCIES = ["display", "light", "api"] -AUTO_LOAD = ["ehmtxv2","json"] +AUTO_LOAD = ["ehmtxv2", "json", "image", "animation"] IMAGE_TYPE_RGB565 = 4 MAXFRAMES = 110 MAXICONS = 120 diff --git a/tests/ulanzi-test.yaml b/tests/ulanzi-test.yaml index 3dc9053..a393c64 100644 --- a/tests/ulanzi-test.yaml +++ b/tests/ulanzi-test.yaml @@ -251,6 +251,6 @@ animation: - id: animation_black file: 1pixel.gif -image: - - id: image_black - file: 1pixel.gif +# image: +# - id: image_black +# file: 1pixel.gif From 4d83d89ddd9d01555595ba108a836c5e2993d8c2 Mon Sep 17 00:00:00 2001 From: "Andrew J.Swan" Date: Mon, 9 Dec 2024 12:19:05 +0200 Subject: [PATCH 2/3] 2024.12.1: Cleanup code --- components/ehmtxv2/EHMTX.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/components/ehmtxv2/EHMTX.h b/components/ehmtxv2/EHMTX.h index 6135e29..7b513a9 100644 --- a/components/ehmtxv2/EHMTX.h +++ b/components/ehmtxv2/EHMTX.h @@ -1,9 +1,6 @@ #ifndef EHMTX_H #define EHMTX_H #include "esphome.h" -// #ifdef EHMTXv2_MULTICOLOR_TEXT -// #include -// #endif #define USE_Fireplugin #include "esphome/components/time/real_time_clock.h" @@ -365,9 +362,6 @@ namespace esphome PROGMEM Color text_color, progressbar_color, progressbar_back_color; PROGMEM std::string text; PROGMEM std::string icon_name; - // #ifdef EHMTXv2_MULTICOLOR_TEXT - // PROGMEM std::array charcolors; - // #endif #endif #ifdef USE_ESP8266 Color text_color, progressbar_color, progressbar_back_color; @@ -380,10 +374,6 @@ namespace esphome Color heatColor(uint8_t temperature); void status(); - // #ifdef EHMTXv2_MULTICOLOR_TEXT - // void multicolor(std::string text,Color c); - // #endif - void draw(); bool isfree(); bool update_slot(uint8_t _icon); From c8c5862e1c243c65a872da48d07b4a75d1ad06fb Mon Sep 17 00:00:00 2001 From: "Andrew J.Swan" Date: Mon, 9 Dec 2024 12:20:57 +0200 Subject: [PATCH 3/3] 2024.12.1: Cleanup code --- components/ehmtxv2/EHMTX_queue.cpp | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/components/ehmtxv2/EHMTX_queue.cpp b/components/ehmtxv2/EHMTX_queue.cpp index df388b5..d8f4a6e 100644 --- a/components/ehmtxv2/EHMTX_queue.cpp +++ b/components/ehmtxv2/EHMTX_queue.cpp @@ -86,25 +86,10 @@ namespace esphome #ifdef EHMTXv2_ADV_BITMAP this->bitmap = nullptr; #endif -// #ifdef EHMTXv2_MULTICOLOR_TEXT -// this->charcolors = {}; -// #endif this->progressbar_color = esphome::display::COLOR_OFF; this->progressbar_back_color = esphome::display::COLOR_OFF; } -// #ifdef EHMTXv2_MULTICOLOR_TEXT -// void EHMTX_queue::multicolor(std::string _text,Color c) -// { -// std::regex color_re("(#[A-Fa-f0-9]{6})"); -// this->text = std::regex_replace(_text, color_re, ""); -// -// for (std::string::size_type i = 0; i < _text.size(); ++i) { -// this->charcolors[i] = c; -// } -// } -// #endif - void EHMTX_queue::status() { switch (this->mode)