@@ -160,7 +160,7 @@ script:
|
|||||||
- lambda: |-
|
- lambda: |-
|
||||||
// Update chips
|
// Update chips
|
||||||
if (id(is_embedded_thermostat))
|
if (id(is_embedded_thermostat))
|
||||||
id(update_climate_icon).execute("home.icon_top_03", int(thermostat_embedded->action), int(thermostat_embedded->mode));
|
update_climate_icon->execute("home.icon_top_03", int(thermostat_embedded->action), int(thermostat_embedded->mode));
|
||||||
|
|
||||||
- id: !extend set_climate
|
- id: !extend set_climate
|
||||||
then:
|
then:
|
||||||
|
|||||||
@@ -113,8 +113,7 @@ time:
|
|||||||
on_time_sync:
|
on_time_sync:
|
||||||
then:
|
then:
|
||||||
- logger.log: "System clock synchronized"
|
- logger.log: "System clock synchronized"
|
||||||
- script.execute:
|
- script.execute: refresh_datetime
|
||||||
id: refresh_datetime
|
|
||||||
|
|
||||||
##### START - API CONFIGURATION #####
|
##### START - API CONFIGURATION #####
|
||||||
api:
|
api:
|
||||||
@@ -1442,12 +1441,10 @@ switch:
|
|||||||
restore_mode: RESTORE_DEFAULT_OFF
|
restore_mode: RESTORE_DEFAULT_OFF
|
||||||
on_turn_on:
|
on_turn_on:
|
||||||
then:
|
then:
|
||||||
- script.execute:
|
- script.execute: refresh_relays
|
||||||
id: refresh_relays
|
|
||||||
on_turn_off:
|
on_turn_off:
|
||||||
then:
|
then:
|
||||||
- script.execute:
|
- script.execute: refresh_relays
|
||||||
id: refresh_relays
|
|
||||||
##### PHYSICAL SWITCH 2 ######
|
##### PHYSICAL SWITCH 2 ######
|
||||||
- name: ${device_name} Relay 2
|
- name: ${device_name} Relay 2
|
||||||
platform: gpio
|
platform: gpio
|
||||||
@@ -1457,12 +1454,10 @@ switch:
|
|||||||
restore_mode: RESTORE_DEFAULT_OFF
|
restore_mode: RESTORE_DEFAULT_OFF
|
||||||
on_turn_on:
|
on_turn_on:
|
||||||
then:
|
then:
|
||||||
- script.execute:
|
- script.execute: refresh_relays
|
||||||
id: refresh_relays
|
|
||||||
on_turn_off:
|
on_turn_off:
|
||||||
then:
|
then:
|
||||||
- script.execute:
|
- script.execute: refresh_relays
|
||||||
id: refresh_relays
|
|
||||||
|
|
||||||
##### DISPLAY ALWAYS ON #####
|
##### DISPLAY ALWAYS ON #####
|
||||||
- name: ${device_name} Nextion display - Power
|
- name: ${device_name} Nextion display - Power
|
||||||
@@ -2209,8 +2204,6 @@ script:
|
|||||||
- id: page_home
|
- id: page_home
|
||||||
mode: restart
|
mode: restart
|
||||||
then:
|
then:
|
||||||
- script.execute: refresh_relays
|
|
||||||
- script.execute: refresh_datetime
|
|
||||||
- script.execute: refresh_wifi_icon
|
- script.execute: refresh_wifi_icon
|
||||||
|
|
||||||
- id: page_keyb_num
|
- id: page_keyb_num
|
||||||
@@ -2324,7 +2317,7 @@ script:
|
|||||||
std::string time_format_str_sleep = time_format_str;
|
std::string time_format_str_sleep = time_format_str;
|
||||||
if (time_format_str_sleep.find("%p") != std::string::npos)
|
if (time_format_str_sleep.find("%p") != std::string::npos)
|
||||||
time_format_str_sleep.replace(time_format_str_sleep.find("%p"), sizeof("%p")-1, meridiem_text.c_str());
|
time_format_str_sleep.replace(time_format_str_sleep.find("%p"), sizeof("%p")-1, meridiem_text.c_str());
|
||||||
disp1->set_component_text_printf("screensaver.text", "%s", id(time_provider).now().strftime(time_format_str_sleep).c_str());
|
disp1->set_component_text_printf("text", "%s", id(time_provider).now().strftime(time_format_str_sleep).c_str());
|
||||||
}
|
}
|
||||||
ESP_LOGV(TAG, "Updating home page meridiem");
|
ESP_LOGV(TAG, "Updating home page meridiem");
|
||||||
disp1->set_component_text_printf("home.meridiem", "%s", (time_format_str.find("%p") != std::string::npos) ? meridiem_text.c_str() : " ");
|
disp1->set_component_text_printf("home.meridiem", "%s", (time_format_str.find("%p") != std::string::npos) ? meridiem_text.c_str() : " ");
|
||||||
@@ -2354,11 +2347,9 @@ script:
|
|||||||
then:
|
then:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
// Chips - Relays
|
// Chips - Relays
|
||||||
if (relay_1->state) disp1->set_component_text_printf("home.icon_top_01", "%s", id(home_relay1_icon).c_str());
|
disp1->set_component_text_printf("home.icon_top_01", "%s", (relay_1->state) ? id(home_relay1_icon).c_str() : "\uFFFF");
|
||||||
else disp1->set_component_text_printf("icon_top_01", "\uFFFF");
|
disp1->set_component_text_printf("home.icon_top_02", "%s", (relay_2->state) ? id(home_relay2_icon).c_str() : "\uFFFF");
|
||||||
if (relay_2->state) disp1->set_component_text_printf("home.icon_top_02", "%s", id(home_relay2_icon).c_str());
|
// Hardware buttons bars - Fallback mode
|
||||||
else disp1->set_component_text_printf("home.icon_top_02", "\uFFFF");
|
|
||||||
// Hardware buttons - Fallback mode
|
|
||||||
if (relay1_local->state) disp1->send_command_printf("home.left_bt_pic.val=%i", (relay_1->state) ? 1 : 0);
|
if (relay1_local->state) disp1->send_command_printf("home.left_bt_pic.val=%i", (relay_1->state) ? 1 : 0);
|
||||||
if (relay2_local->state) disp1->send_command_printf("home.right_bt_pic.val=%i", (relay_2->state) ? 1 : 0);
|
if (relay2_local->state) disp1->send_command_printf("home.right_bt_pic.val=%i", (relay_2->state) ? 1 : 0);
|
||||||
|
|
||||||
@@ -3148,8 +3139,6 @@ script:
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh_wifi_icon->execute();
|
|
||||||
|
|
||||||
// Report ESPHome
|
// Report ESPHome
|
||||||
ESP_LOGI(TAG, "ESPHome:");
|
ESP_LOGI(TAG, "ESPHome:");
|
||||||
ESP_LOGI(TAG, " Version: ${version}");
|
ESP_LOGI(TAG, " Version: ${version}");
|
||||||
@@ -3186,6 +3175,6 @@ script:
|
|||||||
ESP_LOGW(TAG, " TFT: UNKNOWN");
|
ESP_LOGW(TAG, " TFT: UNKNOWN");
|
||||||
else
|
else
|
||||||
ESP_LOGI(TAG, " TFT: %s", version_tft->state.c_str());
|
ESP_LOGI(TAG, " TFT: %s", version_tft->state.c_str());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
refresh_wifi_icon->execute();
|
||||||
ESP_LOGV(TAG, "Finished");
|
ESP_LOGV(TAG, "Finished");
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user