From ff2387e2149368df5961e1bdd2ca306898cbc5da Mon Sep 17 00:00:00 2001 From: LuBeDa Date: Sat, 29 Apr 2023 16:27:34 +0200 Subject: [PATCH] cleanup --- TODO.md | 13 ++++++------- components/ehmtxv2/EHMTX.cpp | 4 ++-- components/ehmtxv2/EHMTX.h | 2 -- components/ehmtxv2/EHMTX_queue.cpp | 16 ---------------- components/ehmtxv2/__init__.py | 2 +- 5 files changed, 9 insertions(+), 28 deletions(-) diff --git a/TODO.md b/TODO.md index 959b539..5561f64 100644 --- a/TODO.md +++ b/TODO.md @@ -4,7 +4,7 @@ - [x] alarm on all screen but fullscreen - [x] indicator on all screen but fullscreen and clock -- [ ] refreshing an icon screen should extend the display time +- [x] refreshing an icon screen should extend the display time - [ ] scroll left to right - [x] size of indicator and alarm - [x] center text @@ -15,17 +15,16 @@ - [ ] seconds point moveable - [ ] seconds point to clock screen only - [x] rainbow icon and text -- [ ] del_slot noch active? -- [ ] CONF_ALARM weg? -- [ ] reintroduce resize -- [ ] +- [x] del_slot noch active? +- [x] CONF_ALARM weg? +- [x] reintroduce resize ## ux - [ ] blueprints - [ ] Color in blueprints - [ ] all modes in one blueprint -- [ ] extem html with more bluepörint helpers +- [ ] external html with more blueprint helpers (icons and modes) - [x] default values for all functions - [x] provide sample font from [url](https://www.pentacom.jp/pentacom/bitfontmaker2/) - [x] start animation @@ -50,4 +49,4 @@ ## noch prüfen - [ ] Timer display with formation H:M:S -- [ ] find a way for automastically add smalfont +- [ ] find a way for automatically add smallfont diff --git a/components/ehmtxv2/EHMTX.cpp b/components/ehmtxv2/EHMTX.cpp index 81545c8..ca39ff5 100644 --- a/components/ehmtxv2/EHMTX.cpp +++ b/components/ehmtxv2/EHMTX.cpp @@ -330,7 +330,7 @@ namespace esphome this->screen_pointer = find_oldest_queue_element(); if (this->screen_pointer != MAXQUEUE) { - this->queue[this->screen_pointer]->reset_shiftx(); + this->queue[this->screen_pointer]->shiftx_ = 0; this->queue[this->screen_pointer]->last_time = ts + this->queue[this->screen_pointer]->screen_time; if (this->queue[this->screen_pointer]->icon < this->icon_count) { @@ -811,7 +811,7 @@ namespace esphome void EHMTX::dump_config() { - ESP_LOGCONFIG(TAG, "EspHoMatriX %s", EHMTX_VERSION); + ESP_LOGCONFIG(TAG, "EspHoMatriXv2 %s", EHMTX_VERSION); ESP_LOGCONFIG(TAG, "Boot anim: %d", this->boot_anim); ESP_LOGCONFIG(TAG, "Icons: %d of %d", this->icon_count, MAXICONS); ESP_LOGCONFIG(TAG, "Max screens: %d", MAXQUEUE); diff --git a/components/ehmtxv2/EHMTX.h b/components/ehmtxv2/EHMTX.h index 09793d5..1773ef7 100644 --- a/components/ehmtxv2/EHMTX.h +++ b/components/ehmtxv2/EHMTX.h @@ -182,10 +182,8 @@ namespace esphome void status(); void draw(); bool isfree(); - void reset_shiftx(); bool update_slot(uint8_t _icon); void update_screen(); - bool del_slot(uint8_t _icon); void hold_slot(uint8_t _sec); void set_text(std::string text, uint8_t icon, uint16_t pixel, uint16_t et, uint16_t st); }; diff --git a/components/ehmtxv2/EHMTX_queue.cpp b/components/ehmtxv2/EHMTX_queue.cpp index f25eae9..df19675 100644 --- a/components/ehmtxv2/EHMTX_queue.cpp +++ b/components/ehmtxv2/EHMTX_queue.cpp @@ -58,22 +58,6 @@ namespace esphome } } - bool EHMTX_queue::del_slot(uint8_t _icon) - { - if (this->icon == _icon) - { - this->endtime = 0; - ESP_LOGW(TAG, "delete screen icon: %d", _icon); - return true; - } - return false; - } - - void EHMTX_queue::reset_shiftx() - { - this->shiftx_ = 0; - } - void EHMTX_queue::update_screen() { if (millis() - this->config_->last_rainbow_time >= this->config_->rainbow_interval) diff --git a/components/ehmtxv2/__init__.py b/components/ehmtxv2/__init__.py index cad5d90..7680922 100644 --- a/components/ehmtxv2/__init__.py +++ b/components/ehmtxv2/__init__.py @@ -85,7 +85,7 @@ CONF_SHOW_SECONDS = "show_seconds" CONF_WEEK_START_MONDAY = "week_start_monday" CONF_ICON = "icon_name" CONF_TEXT = "text" -CONF_ALARM = "alarm" + EHMTX_SCHEMA = cv.Schema({ cv.Required(CONF_ID): cv.declare_id(EHMTX_),