diff --git a/TODO.md b/TODO.md index 25e8427..8bbe503 100644 --- a/TODO.md +++ b/TODO.md @@ -5,6 +5,7 @@ - [ ] screen_time on ms sec base - [ ] scroll left to right - [ ] seconds point moveable +- [ ] dynamic bitmap as json - [x] alarm on all screens but full screen - [x] indicator on all screens but full screen and clock - [x] refreshing an icon screen should extend the display time diff --git a/components/ehmtxv2/EHMTX.cpp b/components/ehmtxv2/EHMTX.cpp index 04d3e37..badffce 100644 --- a/components/ehmtxv2/EHMTX.cpp +++ b/components/ehmtxv2/EHMTX.cpp @@ -9,6 +9,7 @@ namespace esphome this->display_indicator = 0; this->display_alarm = 0; this->clock_time = 10; + this->clock_intervall = 90; this->hold_time = 10; this->icon_count = 0; this->hue_ = 0; @@ -28,6 +29,8 @@ namespace esphome { this->queue[i] = new EHMTX_queue(this); } + this->clock_screen(14 * 24 * 60, this->clock_time, false, C_RED, C_GREEN, C_BLUE); + this->date_screen(14 * 24 * 60, (int)this->clock_time / 2, false, C_RED, C_GREEN, C_BLUE); } void EHMTX::set_time_format(std::string s) @@ -102,6 +105,14 @@ namespace esphome } } + void EHMTX::get_string(std::string text) + { + ESP_LOGD(TAG, "get_string: %s",text.c_str()); + json::parse_json(text,[](JsonObject root) { + ESP_LOGD(TAG, "string1: %s int1", root["string"],root["int"]); + }); + } + uint8_t EHMTX::find_icon(std::string name) { for (uint8_t i = 0; i < this->icon_count; i++) @@ -377,7 +388,6 @@ namespace esphome this->last_scroll_time = millis(); if (this->scroll_step > this->queue[this->screen_pointer]->scroll_reset) { - ESP_LOGD(TAG, "end scroll at: %d",this->scroll_step); this->scroll_step = 0; } } @@ -694,7 +704,7 @@ namespace esphome ESP_LOGD(TAG, "clock_screen_color lifetime: %d screen_time: %d red: %d green: %d blue: %d", lifetime, screen_time, r, g, b); screen->mode = MODE_CLOCK; screen->default_font = default_font; - screen->screen_time_ = (this->clock_interval > screen_time )?screen_time:this->clock_interval-1; + screen->screen_time_ = screen_time; screen->endtime = this->clock->now().timestamp + lifetime * 60; screen->status(); } diff --git a/components/ehmtxv2/EHMTX.h b/components/ehmtxv2/EHMTX.h index 037aa98..19fc05c 100644 --- a/components/ehmtxv2/EHMTX.h +++ b/components/ehmtxv2/EHMTX.h @@ -111,6 +111,7 @@ namespace esphome void hold_screen(int t=30); void set_display(addressable_light::AddressableLightDisplay *disp); void set_clock_interval(uint16_t t=90); + void get_string(std::string); void set_hold_time(uint16_t t=30); void set_clock_time(uint16_t t=10); void set_show_day_of_week(bool b); diff --git a/components/ehmtxv2/EHMTX_queue.cpp b/components/ehmtxv2/EHMTX_queue.cpp index eeeb90c..318c35c 100644 --- a/components/ehmtxv2/EHMTX_queue.cpp +++ b/components/ehmtxv2/EHMTX_queue.cpp @@ -75,6 +75,8 @@ namespace esphome case MODE_RAINBOW_TEXT: // no correction break; + default: + break; } if (this->config_->display_gauge) diff --git a/copy2esphome/ulanzi-easy.yaml b/copy2esphome/ulanzi-easy.yaml index e42d99f..24c1c25 100644 --- a/copy2esphome/ulanzi-easy.yaml +++ b/copy2esphome/ulanzi-easy.yaml @@ -4,6 +4,7 @@ substitutions: board: esp32dev # Pin definition from https://github.com/aptonline/PixelIt_Ulanzi battery_pin: GPIO34 + buzzer_pin: GPIO15 ldr_pin: GPIO35 matrix_pin: GPIO32 left_button_pin: GPIO26 @@ -61,7 +62,13 @@ esphome: on_boot: then: - ds1307.read_time: - + +output: + - platform: gpio + pin: $buzzer_pin + id: quiet_please + + esp32: board: esp32dev diff --git a/tests/ulanzi-easy.yaml b/tests/ulanzi-easy.yaml index 6ab4800..24c1c25 100644 --- a/tests/ulanzi-easy.yaml +++ b/tests/ulanzi-easy.yaml @@ -4,6 +4,7 @@ substitutions: board: esp32dev # Pin definition from https://github.com/aptonline/PixelIt_Ulanzi battery_pin: GPIO34 + buzzer_pin: GPIO15 ldr_pin: GPIO35 matrix_pin: GPIO32 left_button_pin: GPIO26 @@ -61,7 +62,13 @@ esphome: on_boot: then: - ds1307.read_time: - + +output: + - platform: gpio + pin: $buzzer_pin + id: quiet_please + + esp32: board: esp32dev @@ -170,7 +177,7 @@ light: type: GRB internal: true variant: WS2812 - pin: $matrix_pin + pin: $ledpin num_leds: 256 color_correct: [30%, 30%, 30%] gamma_correct: 2.0