From 9858933e68850a6793251fbdde849fcd765e1712 Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Sun, 9 Jul 2023 10:54:22 +0200 Subject: [PATCH 1/2] removed warning --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 1414132e..40f76467 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,5 @@ # EspHoMaTriX version 2 (EHMTXv2) -## Very important information!! -Since esphome 2023.6.0 this does not compile anymore on ESP8266 platform!!! - ## Important information If you like this project, please donate a star on GitHub and consider [sponsoring](https://www.paypal.com/donate/?hosted_button_id=FZDKSLQ46HJTU) me! From 781198d9ca200f262e235e2e9dee06a01f8b6dfa Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Wed, 19 Jul 2023 18:14:18 +0200 Subject: [PATCH 2/2] "fixed" breaking changes of esphom 2023.7.0 --- README.md | 4 ++++ components/ehmtxv2/EHMTX.cpp | 4 ++-- components/ehmtxv2/EHMTX.h | 13 +++++++------ components/ehmtxv2/EHMTX_icons.cpp | 4 ++-- components/ehmtxv2/EHMTX_queue.cpp | 2 +- components/ehmtxv2/__init__.py | 1 + 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 40f76467..37a09277 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # EspHoMaTriX version 2 (EHMTXv2) +## Warning + +Sorry but there this modules is highly dependend from the esphome releases. You can expect that some breaking changes in esphome breaks my code. So This version of EspHoMaTriX is working from esphome **2023.7.0** upwards (hopefully). + ## Important information If you like this project, please donate a star on GitHub and consider [sponsoring](https://www.paypal.com/donate/?hosted_button_id=FZDKSLQ46HJTU) me! diff --git a/components/ehmtxv2/EHMTX.cpp b/components/ehmtxv2/EHMTX.cpp index dde59d2f..d1af779a 100644 --- a/components/ehmtxv2/EHMTX.cpp +++ b/components/ehmtxv2/EHMTX.cpp @@ -674,12 +674,12 @@ namespace esphome ESP_LOGI(TAG, "queue: %d empty slots", empty); } - void EHMTX::set_default_font(display::Font *font) + void EHMTX::set_default_font(display::BaseFont *font) { this->default_font = font; } - void EHMTX::set_special_font(display::Font *font) + void EHMTX::set_special_font(display::BaseFont *font) { this->special_font = font; } diff --git a/components/ehmtxv2/EHMTX.h b/components/ehmtxv2/EHMTX.h index 4553faf9..6bf1231e 100644 --- a/components/ehmtxv2/EHMTX.h +++ b/components/ehmtxv2/EHMTX.h @@ -2,6 +2,7 @@ #define EHMTX_H #include "esphome.h" #include "esphome/components/time/real_time_clock.h" +#include "esphome/components/animation/animation.h" const uint8_t MAXQUEUE = 24; const uint8_t C_RED = 240; // default @@ -92,8 +93,8 @@ namespace esphome EHMTX_Icon *icons[MAXICONS]; uint8_t gauge_value; #endif - display::Font *default_font; - display::Font *special_font; + display::BaseFont *default_font; + display::BaseFont *special_font; int display_rindicator; int display_lindicator; int display_alarm; @@ -147,8 +148,8 @@ namespace esphome void set_display_on(); void set_display_off(); void set_clock(esphome::time::RealTimeClock *clock); - void set_default_font(display::Font *font); - void set_special_font(display::Font *font); + void set_default_font(display::BaseFont *font); + void set_special_font(display::BaseFont *font); void show_rindicator(int r = C_RED, int g = C_GREEN, int b = C_BLUE, int s = 3); void show_lindicator(int r = C_RED, int g = C_GREEN, int b = C_BLUE, int s = 3); void set_clock_color(int r = C_RED, int g = C_GREEN, int b = C_BLUE); @@ -263,13 +264,13 @@ namespace esphome void process(); }; - class EHMTX_Icon : public display::Animation + class EHMTX_Icon : public animation::Animation { protected: bool counting_up; public: - EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, display::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration); + EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, esphome::image::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration); std::string name; uint16_t frame_duration; void next_frame(); diff --git a/components/ehmtxv2/EHMTX_icons.cpp b/components/ehmtxv2/EHMTX_icons.cpp index d667cb15..13f4518b 100644 --- a/components/ehmtxv2/EHMTX_icons.cpp +++ b/components/ehmtxv2/EHMTX_icons.cpp @@ -3,8 +3,8 @@ namespace esphome { - EHMTX_Icon::EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, display::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration) - : Animation(data_start, width, height, animation_frame_count, type) + EHMTX_Icon::EHMTX_Icon(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, esphome::image::ImageType type, std::string icon_name, bool revers, uint16_t frame_duration) + : animation::Animation(data_start, width, height, animation_frame_count, type) { this->name = icon_name; this->reverse = revers; diff --git a/components/ehmtxv2/EHMTX_queue.cpp b/components/ehmtxv2/EHMTX_queue.cpp index 9dd744a5..d920f252 100644 --- a/components/ehmtxv2/EHMTX_queue.cpp +++ b/components/ehmtxv2/EHMTX_queue.cpp @@ -145,7 +145,7 @@ namespace esphome void EHMTX_queue::draw() { - display::Font *font = this->default_font ? this->config_->default_font : this->config_->special_font; + display::BaseFont *font = this->default_font ? this->config_->default_font : this->config_->special_font; int8_t yoffset = this->default_font ? EHMTXv2_DEFAULT_FONT_OFFSET_Y : EHMTXv2_SPECIAL_FONT_OFFSET_Y; int8_t xoffset = this->default_font ? EHMTXv2_DEFAULT_FONT_OFFSET_X : EHMTXv2_SPECIAL_FONT_OFFSET_X; diff --git a/components/ehmtxv2/__init__.py b/components/ehmtxv2/__init__.py index 951e428d..282283fc 100644 --- a/components/ehmtxv2/__init__.py +++ b/components/ehmtxv2/__init__.py @@ -29,6 +29,7 @@ logging.warning(f"") logging.warning(f"Please check the documentation and wiki https://github.com/lubeda/EspHoMaTriXv2") +logging.warning(f"This will only work with esphome >= 2023.7.0") logging.warning(f"") def rgb565_svg(x,y,r,g,b):