Removed lovelace_custom_command
It was not in use
This commit is contained in:
@@ -885,10 +885,6 @@ script:
|
|||||||
disp1->hide_component("bt_close");
|
disp1->hide_component("bt_close");
|
||||||
delay_seconds_(1);
|
delay_seconds_(1);
|
||||||
display_wrapped_text->execute("confirm.body", "Stopping scripts...", 18);
|
display_wrapped_text->execute("confirm.body", "Stopping scripts...", 18);
|
||||||
} else {
|
|
||||||
lovelace_custom_command->execute("pageType~popupNotify");
|
|
||||||
sprintf(update_msg, "entityUpdateDetail~~Upload TFT - %s~65535~~0~~0~Preparing to upload TFT file...~65535~10000~3~~~", framework.c_str());
|
|
||||||
lovelace_custom_command->execute(update_msg);
|
|
||||||
}
|
}
|
||||||
stop_all->execute();
|
stop_all->execute();
|
||||||
if (display_mode->state > 0) delay_seconds_(1);
|
if (display_mode->state > 0) delay_seconds_(1);
|
||||||
@@ -907,10 +903,6 @@ script:
|
|||||||
ESP_LOGD(TAG, update_msg);
|
ESP_LOGD(TAG, update_msg);
|
||||||
if (display_mode->state > 0) {
|
if (display_mode->state > 0) {
|
||||||
display_wrapped_text->execute("confirm.body", update_msg, 18);
|
display_wrapped_text->execute("confirm.body", update_msg, 18);
|
||||||
} else {
|
|
||||||
lovelace_custom_command->execute("pageType~popupNotify");
|
|
||||||
sprintf(update_msg, "entityUpdateDetail~~Upload TFT - %s~65535~~0~~0~Try #1 at %d bps~65535~10000~3~~~", framework.c_str(), target_upload_baud_rate_);
|
|
||||||
lovelace_custom_command->execute(update_msg);
|
|
||||||
}
|
}
|
||||||
delay_seconds_(1);
|
delay_seconds_(1);
|
||||||
if (upload_tft_(url, target_upload_baud_rate_)) App.safe_reboot();
|
if (upload_tft_(url, target_upload_baud_rate_)) App.safe_reboot();
|
||||||
@@ -922,10 +914,6 @@ script:
|
|||||||
ESP_LOGD(TAG, update_msg);
|
ESP_LOGD(TAG, update_msg);
|
||||||
if (display_mode->state > 0) {
|
if (display_mode->state > 0) {
|
||||||
display_wrapped_text->execute("confirm.body", update_msg, 18);
|
display_wrapped_text->execute("confirm.body", update_msg, 18);
|
||||||
} else {
|
|
||||||
lovelace_custom_command->execute("pageType~popupNotify");
|
|
||||||
sprintf(update_msg, "entityUpdateDetail~~Upload TFT - %s~65535~~0~~0~Try #2 at %d bps~65535~10000~3~~~", framework.c_str(), target_upload_baud_rate_);
|
|
||||||
lovelace_custom_command->execute(update_msg);
|
|
||||||
}
|
}
|
||||||
delay_seconds_(1);
|
delay_seconds_(1);
|
||||||
if (upload_tft_(url, target_upload_baud_rate_)) App.safe_reboot();
|
if (upload_tft_(url, target_upload_baud_rate_)) App.safe_reboot();
|
||||||
@@ -937,20 +925,12 @@ script:
|
|||||||
ESP_LOGD(TAG, update_msg);
|
ESP_LOGD(TAG, update_msg);
|
||||||
if (display_mode->state > 0) {
|
if (display_mode->state > 0) {
|
||||||
display_wrapped_text->execute("confirm.body", update_msg, 18);
|
display_wrapped_text->execute("confirm.body", update_msg, 18);
|
||||||
} else {
|
|
||||||
lovelace_custom_command->execute("pageType~popupNotify");
|
|
||||||
sprintf(update_msg, "entityUpdateDetail~~Upload TFT - %s~65535~~0~~0~Try #3 at %d bps~65535~10000~3~~~", framework.c_str(), original_baud_rate_);
|
|
||||||
lovelace_custom_command->execute(update_msg);
|
|
||||||
}
|
}
|
||||||
delay_seconds_(1);
|
delay_seconds_(1);
|
||||||
if (upload_tft_(url, original_baud_rate_)) App.safe_reboot();
|
if (upload_tft_(url, original_baud_rate_)) App.safe_reboot();
|
||||||
ESP_LOGW(TAG, "Try #3 failed");
|
ESP_LOGW(TAG, "Try #3 failed");
|
||||||
if (display_mode->state > 0) {
|
if (display_mode->state > 0) {
|
||||||
display_wrapped_text->execute("confirm.body", "Try #3 failed. Restarting display.", 18);
|
display_wrapped_text->execute("confirm.body", "Try #3 failed. Restarting display.", 18);
|
||||||
} else {
|
|
||||||
lovelace_custom_command->execute("pageType~popupNotify");
|
|
||||||
sprintf(update_msg, "entityUpdateDetail~~Upload TFT - %s~65535~~0~~0~Power cycle display~65535~10000~3~~~", framework.c_str());
|
|
||||||
lovelace_custom_command->execute(update_msg);
|
|
||||||
}
|
}
|
||||||
delay_seconds_(3);
|
delay_seconds_(3);
|
||||||
ESP_LOGD(TAG, "Turn off Nextion");
|
ESP_LOGD(TAG, "Turn off Nextion");
|
||||||
@@ -978,10 +958,6 @@ script:
|
|||||||
disp1->hide_component("bt_accept");
|
disp1->hide_component("bt_accept");
|
||||||
disp1->hide_component("bt_clear");
|
disp1->hide_component("bt_clear");
|
||||||
disp1->hide_component("bt_close");
|
disp1->hide_component("bt_close");
|
||||||
} else {
|
|
||||||
lovelace_custom_command->execute("pageType~popupNotify");
|
|
||||||
sprintf(update_msg, "entityUpdateDetail~~Upload TFT - %s~65535~~0~~0~Try #4 at %d bps~65535~10000~3~~~", framework.c_str(), original_baud_rate_);
|
|
||||||
lovelace_custom_command->execute(update_msg);
|
|
||||||
}
|
}
|
||||||
delay_seconds_(1);
|
delay_seconds_(1);
|
||||||
if (upload_tft_(url, original_baud_rate_)) App.safe_reboot();
|
if (upload_tft_(url, original_baud_rate_)) App.safe_reboot();
|
||||||
@@ -1003,10 +979,6 @@ script:
|
|||||||
disp1->hide_component("bt_accept");
|
disp1->hide_component("bt_accept");
|
||||||
disp1->hide_component("bt_clear");
|
disp1->hide_component("bt_clear");
|
||||||
disp1->hide_component("bt_close");
|
disp1->hide_component("bt_close");
|
||||||
} else {
|
|
||||||
lovelace_custom_command->execute("pageType~popupNotify");
|
|
||||||
sprintf(update_msg, "entityUpdateDetail~~Upload TFT - %s~65535~~0~~0~TFT upload failed.~65535~10000~3~~~", framework.c_str());
|
|
||||||
lovelace_custom_command->execute(update_msg);
|
|
||||||
}
|
}
|
||||||
delay_seconds_(1);
|
delay_seconds_(1);
|
||||||
if (upload_tft_(url, 115200)) App.safe_reboot();
|
if (upload_tft_(url, 115200)) App.safe_reboot();
|
||||||
|
|||||||
@@ -38,8 +38,6 @@ esphome:
|
|||||||
timeout: 10s
|
timeout: 10s
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
if (!disp1->is_setup()) {
|
if (!disp1->is_setup()) {
|
||||||
lovelace_custom_command->execute("pageType~popupNotify");
|
|
||||||
lovelace_custom_command->execute("entityUpdateDetail~~Unsupported TFT file~65535~~0~~0~Please upload a\r\ncompatible TFT file.~65535~10000~3~~~");
|
|
||||||
exit_reparse->execute();
|
exit_reparse->execute();
|
||||||
}
|
}
|
||||||
- wait_until:
|
- wait_until:
|
||||||
@@ -80,8 +78,6 @@ esphome:
|
|||||||
static const char *const TAG = "on_boot";
|
static const char *const TAG = "on_boot";
|
||||||
nextion_status->execute();
|
nextion_status->execute();
|
||||||
if (not disp1->is_setup()) {
|
if (not disp1->is_setup()) {
|
||||||
lovelace_custom_command->execute("pageType~popupNotify");
|
|
||||||
lovelace_custom_command->execute("entityUpdateDetail~~Unsupported TFT file~65535~~0~~0~Please upload a\r\ncompatible TFT file.~65535~10000~3~~~");
|
|
||||||
ESP_LOGE(TAG, "No response from Nextion display");
|
ESP_LOGE(TAG, "No response from Nextion display");
|
||||||
}
|
}
|
||||||
ESP_LOGD(TAG, "Finished");
|
ESP_LOGD(TAG, "Finished");
|
||||||
@@ -1879,40 +1875,6 @@ script:
|
|||||||
}
|
}
|
||||||
ESP_LOGV(TAG, "Finished");
|
ESP_LOGV(TAG, "Finished");
|
||||||
|
|
||||||
- id: lovelace_custom_command
|
|
||||||
mode: queued
|
|
||||||
parameters:
|
|
||||||
command: string
|
|
||||||
then:
|
|
||||||
#- lambda: |-
|
|
||||||
# static const char *const TAG = "script.lovelace_custom_command";
|
|
||||||
# ESP_LOGV(TAG, "Sending command: %s", command.c_str());
|
|
||||||
|
|
||||||
# auto crc16 = [](const uint8_t *data, uint16_t len) -> uint16_t {
|
|
||||||
# uint16_t crc = 0xFFFF;
|
|
||||||
# while (len--) {
|
|
||||||
# crc ^= *data++;
|
|
||||||
# for (uint8_t i = 0; i < 8; i++) {
|
|
||||||
# if ((crc & 0x01) != 0) {
|
|
||||||
# crc >>= 1;
|
|
||||||
# crc ^= 0xA001;
|
|
||||||
# } else {
|
|
||||||
# crc >>= 1;
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# }
|
|
||||||
# return crc;
|
|
||||||
# };
|
|
||||||
|
|
||||||
# std::vector<uint8_t> data = {0x55, 0xBB};
|
|
||||||
# data.push_back(command.length() & 0xFF);
|
|
||||||
# data.push_back((command.length() >> 8) & 0xFF);
|
|
||||||
# data.insert(data.end(), command.begin(), command.end());
|
|
||||||
# auto crc = crc16(data.data(), data.size());
|
|
||||||
# data.push_back(crc & 0xFF);
|
|
||||||
# data.push_back((crc >> 8) & 0xFF);
|
|
||||||
# tf_uart->write_array(data.data(), data.size());
|
|
||||||
|
|
||||||
- id: nextion_status
|
- id: nextion_status
|
||||||
mode: restart
|
mode: restart
|
||||||
then:
|
then:
|
||||||
@@ -2636,7 +2598,6 @@ script:
|
|||||||
global_settings->stop();
|
global_settings->stop();
|
||||||
ha_button->stop();
|
ha_button->stop();
|
||||||
ha_call_service->stop();
|
ha_call_service->stop();
|
||||||
lovelace_custom_command->stop();
|
|
||||||
nextion_status->stop();
|
nextion_status->stop();
|
||||||
notification_clear->stop();
|
notification_clear->stop();
|
||||||
open_entity_settings_page->stop();
|
open_entity_settings_page->stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user