From 536f3b1d7cecfb2ad7d4f0e683d65c84a1159ed9 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Sat, 2 Nov 2024 21:44:26 +0100 Subject: [PATCH] Use `BOOT_STEP_VERSIONING` for API flag Solves #2331 --- esphome/nspanel_esphome_core_hw_wifi.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/esphome/nspanel_esphome_core_hw_wifi.yaml b/esphome/nspanel_esphome_core_hw_wifi.yaml index 6dfd248e7..ad14a2521 100644 --- a/esphome/nspanel_esphome_core_hw_wifi.yaml +++ b/esphome/nspanel_esphome_core_hw_wifi.yaml @@ -93,20 +93,21 @@ script: mode: restart then: - lambda: |- - set_variable_value->execute("api", (wifi_component->is_connected() and api_server->is_connected() and is_boot_complete()) ? 1 : 0); + const bool is_blueprint_connected = is_boot_step_completed(${BOOT_STEP_VERSIONING}); + set_variable_value->execute("api", + (is_blueprint_connected and wifi_component->is_connected() and api_server->is_connected()) ? 1 : 0); // Update Wi-Fi icon color set_component_font_color->execute("home", "wifi_icon", - (wifi_component->is_connected() and api_server->is_connected() and is_boot_complete()) ? - (wifi_rssi->state > -70 ? 33808 : 64992) : - 63488); + (is_blueprint_connected and wifi_component->is_connected() and api_server->is_connected()) ? + (wifi_rssi->state > -70 ? 33808 : 64992) : 63488); // Update Wi-Fi icon set_component_text->execute("home", "wifi_icon", wifi_component->is_connected() ? (api_server->is_connected() ? - ((is_boot_complete()) ? "\uE5A8" : // mdi:wifi - All right! - "\uE7CF") : // mdi:home-assistant - Boot incomplete - "\uF256") : // mdi:api-off - "\uE5A9"); // mdi:wifi-off + (is_blueprint_connected ? "\uE5A8" : // mdi:wifi - All right! + "\uE7CF") : // mdi:home-assistant - Boot incomplete + "\uF256") : // mdi:api-off + "\uE5A9"); // mdi:wifi-off - id: !extend stop_all then: