Skip to content

Commit 781198d

Browse files
committed
"fixed" breaking changes of esphom 2023.7.0
1 parent 9858933 commit 781198d

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# EspHoMaTriX version 2 (EHMTXv2)
22

3+
## Warning
4+
5+
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).
6+
37
## Important information
48

59
If you like this project, please donate a star on GitHub and consider [sponsoring](https://www.paypal.com/donate/?hosted_button_id=FZDKSLQ46HJTU) me!

components/ehmtxv2/EHMTX.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,12 +674,12 @@ namespace esphome
674674
ESP_LOGI(TAG, "queue: %d empty slots", empty);
675675
}
676676

677-
void EHMTX::set_default_font(display::Font *font)
677+
void EHMTX::set_default_font(display::BaseFont *font)
678678
{
679679
this->default_font = font;
680680
}
681681

682-
void EHMTX::set_special_font(display::Font *font)
682+
void EHMTX::set_special_font(display::BaseFont *font)
683683
{
684684
this->special_font = font;
685685
}

components/ehmtxv2/EHMTX.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define EHMTX_H
33
#include "esphome.h"
44
#include "esphome/components/time/real_time_clock.h"
5+
#include "esphome/components/animation/animation.h"
56

67
const uint8_t MAXQUEUE = 24;
78
const uint8_t C_RED = 240; // default
@@ -92,8 +93,8 @@ namespace esphome
9293
EHMTX_Icon *icons[MAXICONS];
9394
uint8_t gauge_value;
9495
#endif
95-
display::Font *default_font;
96-
display::Font *special_font;
96+
display::BaseFont *default_font;
97+
display::BaseFont *special_font;
9798
int display_rindicator;
9899
int display_lindicator;
99100
int display_alarm;
@@ -147,8 +148,8 @@ namespace esphome
147148
void set_display_on();
148149
void set_display_off();
149150
void set_clock(esphome::time::RealTimeClock *clock);
150-
void set_default_font(display::Font *font);
151-
void set_special_font(display::Font *font);
151+
void set_default_font(display::BaseFont *font);
152+
void set_special_font(display::BaseFont *font);
152153
void show_rindicator(int r = C_RED, int g = C_GREEN, int b = C_BLUE, int s = 3);
153154
void show_lindicator(int r = C_RED, int g = C_GREEN, int b = C_BLUE, int s = 3);
154155
void set_clock_color(int r = C_RED, int g = C_GREEN, int b = C_BLUE);
@@ -263,13 +264,13 @@ namespace esphome
263264
void process();
264265
};
265266

266-
class EHMTX_Icon : public display::Animation
267+
class EHMTX_Icon : public animation::Animation
267268
{
268269
protected:
269270
bool counting_up;
270271

271272
public:
272-
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);
273+
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);
273274
std::string name;
274275
uint16_t frame_duration;
275276
void next_frame();

components/ehmtxv2/EHMTX_icons.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
namespace esphome
44
{
55

6-
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)
7-
: Animation(data_start, width, height, animation_frame_count, type)
6+
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)
7+
: animation::Animation(data_start, width, height, animation_frame_count, type)
88
{
99
this->name = icon_name;
1010
this->reverse = revers;

components/ehmtxv2/EHMTX_queue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ namespace esphome
145145

146146
void EHMTX_queue::draw()
147147
{
148-
display::Font *font = this->default_font ? this->config_->default_font : this->config_->special_font;
148+
display::BaseFont *font = this->default_font ? this->config_->default_font : this->config_->special_font;
149149
int8_t yoffset = this->default_font ? EHMTXv2_DEFAULT_FONT_OFFSET_Y : EHMTXv2_SPECIAL_FONT_OFFSET_Y;
150150
int8_t xoffset = this->default_font ? EHMTXv2_DEFAULT_FONT_OFFSET_X : EHMTXv2_SPECIAL_FONT_OFFSET_X;
151151

components/ehmtxv2/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
logging.warning(f"")
3131
logging.warning(f"Please check the documentation and wiki https://github.com/lubeda/EspHoMaTriXv2")
32+
logging.warning(f"This will only work with esphome >= 2023.7.0")
3233
logging.warning(f"")
3334

3435
def rgb565_svg(x,y,r,g,b):

0 commit comments

Comments
 (0)