Skip to content

Commit

Permalink
Merge pull request #257 from andrewjswan/2024.12.1-Removed_unused_com…
Browse files Browse the repository at this point in the history
…ponents_corrected_version

2024.12.1: Removed unused components, corrected version
  • Loading branch information
lubeda authored Dec 11, 2024
2 parents 4c5c5e9 + c8c5862 commit e11dd39
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 deletions.
13 changes: 1 addition & 12 deletions components/ehmtxv2/EHMTX.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#ifndef EHMTX_H
#define EHMTX_H
#include "esphome.h"
#ifdef EHMTXv2_MULTICOLOR_TEXT
#include <array>
#endif
#define USE_Fireplugin
#include "esphome/components/time/real_time_clock.h"

Expand Down Expand Up @@ -38,7 +35,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
Expand Down Expand Up @@ -365,10 +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<Color, 96> charcolors;

#endif
#endif
#ifdef USE_ESP8266
Color text_color, progressbar_color, progressbar_back_color;
Expand All @@ -381,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);
Expand Down
15 changes: 0 additions & 15 deletions components/ehmtxv2/EHMTX_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,26 +85,11 @@ namespace esphome
this->sbitmap = nullptr;
#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)
Expand Down
2 changes: 1 addition & 1 deletion components/ehmtxv2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/ulanzi-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit e11dd39

Please sign in to comment.