"bluescreen on Boot"

develop
LuBeDa 3 years ago
parent 79587a7c64
commit d01c63f96f

@ -348,8 +348,11 @@ namespace esphome
void EHMTX::remove_expired_queue_element()
{
time_t ts = this->clock->now().timestamp;
if (this->clock->now().is_valid())
{
std::string infotext;
time_t ts = this->clock->now().timestamp;
for (size_t i = 0; i < MAXQUEUE; i++)
{
if ((this->queue[i]->endtime > 0) && (this->queue[i]->endtime < ts))
@ -384,6 +387,9 @@ namespace esphome
case MODE_TEXT_SCREEN:
infotext = "TEXT";
break;
case MODE_BITMAP_SCREEN:
infotext = "BITMAP";
break;
default:
break;
}
@ -394,7 +400,7 @@ namespace esphome
}
}
}
}
void EHMTX::tick()
{
this->hue_++;
@ -406,10 +412,10 @@ namespace esphome
esphome::hsv_to_rgb(this->hue_, 0.8, 0.8, red, green, blue);
this->rainbow_color = Color(uint8_t(255 * red), uint8_t(255 * green), uint8_t(255 * blue));
if (this->is_running && this->clock->now().is_valid())
{
time_t ts = this->clock->now().timestamp;
if (this->is_running)
{
if (millis() - this->last_scroll_time >= this->scroll_interval)
{
this->scroll_step++;
@ -940,10 +946,6 @@ namespace esphome
{
ESP_LOGCONFIG(TAG, "weekstart: sunday");
}
if (this->clock->now().is_valid())
{
this->is_running = true;
}
}
void EHMTX::add_icon(EHMTX_Icon *icon)

@ -37,7 +37,7 @@ namespace esphome
class EHMTX : public PollingComponent, public api::CustomAPIDevice {
protected:
float get_setup_priority() const override { return esphome::setup_priority::BEFORE_CONNECTION; }
float get_setup_priority() const override { return esphome::setup_priority::AFTER_WIFI; }
uint8_t brightness_;
uint32_t boot_anim=0;
uint8_t screen_pointer;

Loading…
Cancel
Save