Skip to content

Commit

Permalink
Use BOOT_STEP_VERSIONING for API flag
Browse files Browse the repository at this point in the history
Solves #2331
  • Loading branch information
edwardtfn committed Nov 2, 2024
1 parent 946e151 commit 536f3b1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions esphome/nspanel_esphome_core_hw_wifi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 536f3b1

Please sign in to comment.