@@ -179,6 +179,14 @@ script:
|
||||
then:
|
||||
- switch.turn_on: screen_power
|
||||
- delay: 5s
|
||||
- lambda: if (id(tft_is_valid)) disp1->goto_page("home");
|
||||
- delay: 2s
|
||||
- script.execute: open_upload_dialog
|
||||
- script.wait: open_upload_dialog
|
||||
- wait_until:
|
||||
condition:
|
||||
- lambda: return (current_page->state == "confirm");
|
||||
timeout: 2s
|
||||
# Then start the upload
|
||||
- lambda: |-
|
||||
static const char *const TAG = "addon_upload_tft.script.upload_tft";
|
||||
@@ -195,7 +203,31 @@ script:
|
||||
ESP_LOGD(TAG, " Upload URL: %s", url.c_str());
|
||||
disp1->set_tft_url(url.c_str());
|
||||
|
||||
- lambda: if (id(tft_is_valid)) disp1->goto_page("home");
|
||||
#ifdef USE_ESP32_BLE_CLIENT
|
||||
ble_tracker->dump_config();
|
||||
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()));
|
||||
if (ble_proxy->has_active()) {
|
||||
ESP_LOGD(TAG, " BT proxy set passive mode...");
|
||||
ble_proxy->set_active(false);
|
||||
}
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
App.feed_wdt();
|
||||
}
|
||||
#endif // USE_BLUETOOTH_PROXY
|
||||
ESP_LOGD(TAG, " Stopping BLE Tracker scan...");
|
||||
ble_tracker->stop_scan();
|
||||
ESP_LOGD(TAG, " Disabling BLE Tracker scan...");
|
||||
ble_tracker->set_scan_active(false);
|
||||
ESP_LOGD(TAG, " Disabling BLE...");
|
||||
ble_tracker->get_parent()->disable();
|
||||
ble_tracker->dump_config();
|
||||
#endif // USE_ESP32_BLE_CLIENT
|
||||
|
||||
- lambda: if (id(tft_is_valid) and current_page->state != "confirm") disp1->goto_page("home");
|
||||
- delay: 2s
|
||||
- script.execute: open_upload_dialog
|
||||
- script.wait: open_upload_dialog
|
||||
|
||||
Reference in New Issue
Block a user