Reboot with Wi-Fi timeout
This commit is contained in:
@@ -739,6 +739,12 @@ display:
|
|||||||
##### START - GLOBALS CONFIGURATION #####
|
##### START - GLOBALS CONFIGURATION #####
|
||||||
globals:
|
globals:
|
||||||
|
|
||||||
|
##### Wi-Fi timeout #####
|
||||||
|
- id: wifi_timeout
|
||||||
|
type: uint
|
||||||
|
restore_value: false
|
||||||
|
initial_value: '15'
|
||||||
|
|
||||||
##### Is uploading TFT #####
|
##### Is uploading TFT #####
|
||||||
- id: is_uploading_tft
|
- id: is_uploading_tft
|
||||||
type: bool
|
type: bool
|
||||||
@@ -828,7 +834,7 @@ globals:
|
|||||||
|
|
||||||
- id: mui_time_format
|
- id: mui_time_format
|
||||||
type: std::string
|
type: std::string
|
||||||
restore_value: false
|
restore_value: true
|
||||||
initial_value: '"%H:%M"'
|
initial_value: '"%H:%M"'
|
||||||
- id: home_time_color
|
- id: home_time_color
|
||||||
type: uint
|
type: uint
|
||||||
@@ -848,7 +854,7 @@ globals:
|
|||||||
##### Relay icons #####
|
##### Relay icons #####
|
||||||
- id: home_relay1_icon
|
- id: home_relay1_icon
|
||||||
type: std::string
|
type: std::string
|
||||||
restore_value: false
|
restore_value: true
|
||||||
initial_value: ''
|
initial_value: ''
|
||||||
- id: home_relay1_icon_color
|
- id: home_relay1_icon_color
|
||||||
type: uint16_t
|
type: uint16_t
|
||||||
@@ -857,7 +863,7 @@ globals:
|
|||||||
|
|
||||||
- id: home_relay2_icon
|
- id: home_relay2_icon
|
||||||
type: std::string
|
type: std::string
|
||||||
restore_value: false
|
restore_value: true
|
||||||
initial_value: ''
|
initial_value: ''
|
||||||
- id: home_relay2_icon_color
|
- id: home_relay2_icon_color
|
||||||
type: uint16_t
|
type: uint16_t
|
||||||
@@ -3011,8 +3017,14 @@ script:
|
|||||||
disp1->send_command_printf("api=%i", id(is_blueprint_updated) ? 1 : 0);
|
disp1->send_command_printf("api=%i", id(is_blueprint_updated) ? 1 : 0);
|
||||||
|
|
||||||
if (!wifi_connected) {
|
if (!wifi_connected) {
|
||||||
ESP_LOGD(TAG, "Retrying Wi-Fi connection");
|
if (id(wifi_timeout) > 0) {
|
||||||
wifi_component->retry_connect();
|
id(wifi_timeout)--;
|
||||||
|
ESP_LOGD(TAG, "Retrying Wi-Fi connection");
|
||||||
|
wifi_component->retry_connect();
|
||||||
|
} else {
|
||||||
|
ESP_LOGE(TAG, "Restarting ESP due to a Wi-Fi timeout...");
|
||||||
|
App.safe_reboot();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (api_connected) {
|
if (api_connected) {
|
||||||
if (not id(is_blueprint_updated)) {
|
if (not id(is_blueprint_updated)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user