Removed lovelace_custom_command

It was not in use
This commit is contained in:
Edward Firmo
2023-12-27 18:18:37 +01:00
parent 27bdc3272b
commit 801fc83986
3 changed files with 1 additions and 68 deletions

View File

@@ -205,4 +205,4 @@ script:
(addon_climate_heat && addon_climate_dual) ||
(!addon_climate_cool && !addon_climate_heat && !addon_climate_dual)) {
ESP_LOGE(TAG, "Invalid settings for add-on Climate");
}
}

View File

@@ -885,10 +885,6 @@ script:
disp1->hide_component("bt_close");
delay_seconds_(1);
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();
if (display_mode->state > 0) delay_seconds_(1);
@@ -907,10 +903,6 @@ script:
ESP_LOGD(TAG, update_msg);
if (display_mode->state > 0) {
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);
if (upload_tft_(url, target_upload_baud_rate_)) App.safe_reboot();
@@ -922,10 +914,6 @@ script:
ESP_LOGD(TAG, update_msg);
if (display_mode->state > 0) {
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);
if (upload_tft_(url, target_upload_baud_rate_)) App.safe_reboot();
@@ -937,20 +925,12 @@ script:
ESP_LOGD(TAG, update_msg);
if (display_mode->state > 0) {
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);
if (upload_tft_(url, original_baud_rate_)) App.safe_reboot();
ESP_LOGW(TAG, "Try #3 failed");
if (display_mode->state > 0) {
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);
ESP_LOGD(TAG, "Turn off Nextion");
@@ -978,10 +958,6 @@ script:
disp1->hide_component("bt_accept");
disp1->hide_component("bt_clear");
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);
if (upload_tft_(url, original_baud_rate_)) App.safe_reboot();
@@ -1003,10 +979,6 @@ script:
disp1->hide_component("bt_accept");
disp1->hide_component("bt_clear");
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);
if (upload_tft_(url, 115200)) App.safe_reboot();

View File

@@ -38,8 +38,6 @@ esphome:
timeout: 10s
- lambda: |-
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();
}
- wait_until:
@@ -80,8 +78,6 @@ esphome:
static const char *const TAG = "on_boot";
nextion_status->execute();
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_LOGD(TAG, "Finished");
@@ -1879,40 +1875,6 @@ script:
}
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
mode: restart
then:
@@ -2636,7 +2598,6 @@ script:
global_settings->stop();
ha_button->stop();
ha_call_service->stop();
lovelace_custom_command->stop();
nextion_status->stop();
notification_clear->stop();
open_entity_settings_page->stop();