Skip to content

Commit

Permalink
"polymorphic" constructor workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
lubeda committed Jun 9, 2024
1 parent 55cbaee commit 27e9bc9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions components/ehmtxv2/EHMTX.h
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ namespace esphome
{
protected:
EHMTX *config_;
void init(EHMTX *config);

public:
uint16_t pixels_;
Expand Down Expand Up @@ -380,6 +381,7 @@ namespace esphome
EHMTX_queue(EHMTX *config,std::string text);
Color heatColor(uint8_t temperature);
void status();

void draw();
bool isfree();
bool update_slot(uint8_t _icon);
Expand Down
11 changes: 8 additions & 3 deletions components/ehmtxv2/EHMTX_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ namespace esphome

#endif

EHMTX_queue::EHMTX_queue(EHMTX *config)
{
void EHMTX_queue::init(EHMTX *config)
{
this->config_ = config;
this->endtime = 0.0;
this->last_time = 0.0;
Expand All @@ -91,11 +91,16 @@ namespace esphome
#endif
this->progressbar_color = esphome::display::COLOR_OFF;
this->progressbar_back_color = esphome::display::COLOR_OFF;
}

EHMTX_queue::EHMTX_queue(EHMTX *config)
{
init(config);
}

EHMTX_queue::EHMTX_queue(EHMTX *config, std::string text_)
{
EHMTX_queue(config);
init(config_);

text = text_;
}
Expand Down

0 comments on commit 27e9bc9

Please sign in to comment.