This commit is contained in:
Edward Firmo
2024-03-15 01:36:20 +01:00
parent 9e14c2f5d8
commit 904937f06f

View File

@@ -110,13 +110,9 @@ wifi:
ssid: ${wifi_ssid}
password: ${wifi_password}
on_connect:
- lambda: |-
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();
- script.execute: refresh_wifi_icon
on_disconnect:
- lambda: |-
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();
- script.execute: refresh_wifi_icon
##### OTA PASSWORD #####
ota:
@@ -178,13 +174,9 @@ api:
id: api_server
reboot_timeout: 60min
on_client_connected:
- lambda: |-
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();
- script.execute: refresh_wifi_icon
on_client_disconnected:
- lambda: |-
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();
- script.execute: refresh_wifi_icon
services:
# Dynamically configures button properties on a specified page, enhancing UI interactivity by allowing updates to button appearance and behavior based on given parameters.
- service: button # yamllint disable-line rule:indentation
@@ -282,7 +274,7 @@ api:
if (entity_id.domain != "invalid" or entity == "embedded_climate") {
detailed_entity->publish_state(entity);
if (entity_id.domain == "alarm_control_panel") entity_id.domain = "alarm";
disp1->send_command_printf("page %s", entity_id.domain.c_str());
disp1->goto_page(entity_id.domain.c_str());
disp1->send_command_printf("back_page_id=%" PRIu8, get_page_id(back_page.c_str()));
if (entity_id.domain == "climate")
disp1->set_component_value("embedded", (entity == "embedded_climate") ? 1 : 0);
@@ -1446,10 +1438,7 @@ sensor:
return 0;
on_value:
then:
- lambda: |-
// Update api value on Nextion
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected() and x > 99) ? 1 : 0);
refresh_wifi_icon->execute();
- script.execute: refresh_wifi_icon
##### INTERNAL TEMPERATURE SENSOR, ADC VALUE #####
- id: ntc_source
@@ -2442,6 +2431,7 @@ script:
then:
- lambda: |-
if (nextion_init->state) {
disp1->send_command_printf("api=%i", (wifi_component->is_connected() and api_server->is_connected() and blueprint_status->state > 99) ? 1 : 0);
// Update Wi-Fi icon color
disp1->set_component_font_color("home.wifi_icon", (blueprint_status->state > 99) ? (wifi_rssi->state > -70 ? 33808 : 64992) : 63488);
// Update Wi-Fi icon