Replace watchdog by dump_config

This commit is contained in:
Edward Firmo
2024-04-18 03:25:06 +02:00
parent 85d6abae93
commit ddea304d1b
3 changed files with 248 additions and 227 deletions

View File

@@ -89,6 +89,16 @@ globals:
initial_value: 'esphome::nextion::Nextion::TFTUploadResult::UNKNOWN'
script:
- id: !extend dump_config
then:
- lambda: |-
if (!id(is_uploading_tft)) {
static const char *const TAG = "nspanel_ha_blueprint";
ESP_LOGCONFIG(TAG, "Add-on Upload TFT:");
ESP_LOGCONFIG(TAG, " File model: %s", tft_file_model->state.c_str());
ESP_LOGCONFIG(TAG, " Valid TFT: %s", YESNO(id(tft_is_valid)));
}
- id: nextion_status
mode: restart
then:
@@ -219,13 +229,20 @@ script:
ESP_LOGD(TAG, "Disable BLE");
#ifdef USE_BLUETOOTH_PROXY
ESP_LOGD(TAG, " Bluetooth proxy: %s", ble_proxy->has_active() ? "Active" : "Passive");
while (ble_proxy->has_active() and ble_proxy->get_bluetooth_connections_limit() != ble_proxy->get_bluetooth_connections_free()) {
ESP_LOGD(TAG, " BT proxy connections: %i of %i", int(ble_proxy->get_bluetooth_connections_limit() - ble_proxy->get_bluetooth_connections_free()), int(ble_proxy->get_bluetooth_connections_limit()));
while (ble_proxy->has_active() and
ble_proxy->get_bluetooth_connections_limit() != ble_proxy->get_bluetooth_connections_free()) {
ESP_LOGD(TAG, " BT proxy connections: %i of %i",
int(ble_proxy->get_bluetooth_connections_limit() - ble_proxy->get_bluetooth_connections_free()),
int(ble_proxy->get_bluetooth_connections_limit()));
if (ble_proxy->has_active()) {
ESP_LOGD(TAG, " BT proxy set passive mode...");
ble_proxy->set_active(false);
}
#ifdef ARDUINO
delay(1000);
#elif defined(USE_ESP_IDF)
vTaskDelay(pdMS_TO_TICKS(1000));
#endif
App.feed_wdt();
}
#endif // USE_BLUETOOTH_PROXY
@@ -398,16 +415,6 @@ script:
ESP_LOGI("addon_upload_tft.script.upload_tft_attempt", "Restarting ESPHome");
App.safe_reboot();
- id: !extend watchdog
then:
- lambda: |-
if (!id(is_uploading_tft)) {
static const char *const TAG = "addon_upload_tft.script.watchdog";
ESP_LOGI(TAG, "Add-on Upload TFT:");
ESP_LOGI(TAG, " File model: %s", tft_file_model->state.c_str());
ESP_LOGI(TAG, " Valid TFT: %s", YESNO(id(tft_is_valid)));
}
select:
- id: tft_file_model
name: Update TFT display - Model