bitmap_screen

pull/17/head
LuBeDa 3 years ago
parent 662f68919d
commit 27f43f8b95

@ -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

@ -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();
}

@ -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);

@ -75,6 +75,8 @@ namespace esphome
case MODE_RAINBOW_TEXT:
// no correction
break;
default:
break;
}
if (this->config_->display_gauge)

@ -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

@ -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

Loading…
Cancel
Save