Use blueprint status to set api variable on TFT

This commit is contained in:
Edward Firmo
2024-03-13 21:25:58 +01:00
parent 1d95198312
commit dd6dd172e2

View File

@@ -115,11 +115,11 @@ wifi:
password: ${ap_password}
on_connect:
- lambda: |-
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected()) ? 1 : 0);
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected() and blueprint_status->state > 99) ? 1 : 0);
refresh_wifi_icon->execute();
on_disconnect:
- lambda: |-
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected()) ? 1 : 0);
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected() and blueprint_status->state > 99) ? 1 : 0);
refresh_wifi_icon->execute();
##### OTA PASSWORD #####
@@ -183,11 +183,11 @@ api:
reboot_timeout: 60min
on_client_connected:
- lambda: |-
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected()) ? 1 : 0);
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected() and blueprint_status->state > 99) ? 1 : 0);
refresh_wifi_icon->execute();
on_client_disconnected:
- lambda: |-
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected()) ? 1 : 0);
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected() and blueprint_status->state > 99) ? 1 : 0);
refresh_wifi_icon->execute();
services:
# Dynamically configures button properties on a specified page, enhancing UI interactivity by allowing updates to button appearance and behavior based on given parameters.
@@ -1459,7 +1459,8 @@ sensor:
then:
- lambda: |-
// Update api value on Nextion
disp1->send_command_printf("api=%i", (x > 99) ? 1 : 0);
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected() and x > 99) ? 1 : 0);
refresh_wifi_icon->execute();
##### INTERNAL TEMPERATURE SENSOR, ADC VALUE #####
- id: ntc_source