8 Commits

Author SHA1 Message Date
Edward Firmo
94db496d30 Bring back exit reparse button
Tests failed
2023-11-03 18:12:40 +01:00
Edward Firmo
5a782bbe45 Retry when Upload TFT fails 2023-11-03 18:05:43 +01:00
Edward Firmo
a80a2b7985 Add checkout to each action 2023-11-03 17:48:28 +01:00
Edward Firmo
53e4dd7b81 Fix dependencies on build_advanced 2023-11-03 17:45:35 +01:00
Edward Firmo
955a7fbd8b Remove "Exit reparse" button
It's functionality is now embedded in the Upload TFT calls.
2023-11-03 17:43:06 +01:00
Edward Firmo
9fa172ef36 Advanced validation of ESPHome 2023-11-03 17:40:43 +01:00
Edward Firmo
ffce653d16 Fix reference to external components 2023-11-03 17:14:20 +01:00
Edward Firmo
852ba63038 Use pr5667 for Nextion 2023-11-03 15:26:00 +01:00
4 changed files with 168 additions and 79 deletions

104
.github/workflows/validate_esphome.yml vendored Normal file
View File

@@ -0,0 +1,104 @@
name: Validate ESPHome
on:
push:
paths:
- "nspanel_esphome*.yaml"
pull_request:
#schedule:
# - cron: "0 0 * * *"
workflow_dispatch:
concurrency:
# yamllint disable-line rule:line-length
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
code_scan:
name: Code scan (YAML)
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4.1.0
- name: Validate nspanel_esphome.yaml
run: yamllint -c "./.yamllint/rules.yml" nspanel_esphome.yaml
- name: Validate nspanel_esphome_advanced.yaml
run: yamllint -c "./.yamllint/rules.yml" nspanel_esphome_advanced.yaml
- name: Validate nspanel_esphome_addon_climate_cool.yaml
run: yamllint -c "./.yamllint/rules.yml" nspanel_esphome_addon_climate_cool.yaml
- name: Validate nspanel_esphome_addon_climate_heat.yaml
run: yamllint -c "./.yamllint/rules.yml" nspanel_esphome_addon_climate_heat.yaml
build_core:
name: Build core
runs-on: "ubuntu-latest"
needs:
- code_scan
steps:
- uses: actions/checkout@v4.1.0
- name: Build core
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_core.yaml"
build_advanced:
name: Build advanced
runs-on: "ubuntu-latest"
needs:
- build_core
steps:
- uses: actions/checkout@v4.1.0
- name: Build core+advanced
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced.yaml"
build_climate_heat:
name: Build climate (heat)
runs-on: "ubuntu-latest"
needs:
- build_core
steps:
- uses: actions/checkout@v4.1.0
- name: Build core+climate_heat
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_climate_heat.yaml"
build_climate_cool:
name: Build climate (cool)
runs-on: "ubuntu-latest"
needs:
- build_core
steps:
- uses: actions/checkout@v4.1.0
- name: Build core+climate_cool
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_climate_cool.yaml"
build_climate_heat_advanced:
name: Build advanced climate (heat)
runs-on: "ubuntu-latest"
needs:
- build_climate_heat
- build_advanced
steps:
- uses: actions/checkout@v4.1.0
- name: Build core+advanced+climate_heat
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced_climate_heat.yaml"
build_climate_heat_advanced_arduino:
name: Build arduino
runs-on: "ubuntu-latest"
needs:
- build_climate_heat
- build_advanced
steps:
- uses: actions/checkout@v4.1.0
- name: Build core+advanced+climate_heat+arduino
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced_climate_heat_arduino.yaml"

View File

@@ -1,42 +0,0 @@
name: Validate ESPHome build
on:
push:
paths:
- "nspanel_esphome*.yaml"
pull_request:
#schedule:
# - cron: "0 0 * * *"
workflow_dispatch:
jobs:
code_scan:
name: Validate ESPHome build
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4.1.0
- name: Build core
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_core.yaml"
- name: Build core+advanced
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced.yaml"
- name: Build core+climate_heat
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_climate_heat.yaml"
- name: Build core+climate_cool
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_climate_cool.yaml"
- name: Build core+advanced+climate_heat
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced_climate_heat.yaml"
- name: Build core+advanced+climate_heat+arduino
uses: esphome/build-action@v1.8.0
with:
yaml_file: "./.test/esphome_advanced_climate_heat_arduino.yaml"

View File

@@ -1,25 +0,0 @@
name: Validate ESPHome YAML
on:
push:
paths:
- "nspanel_esphome*.yaml"
pull_request:
#schedule:
# - cron: "0 0 * * *"
workflow_dispatch:
jobs:
code_scan:
name: Validate ESPHome YAML
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4.1.0
- name: Validate nspanel_esphome.yaml
run: yamllint -c "./.yamllint/rules.yml" nspanel_esphome.yaml
- name: Validate nspanel_esphome_advanced.yaml
run: yamllint -c "./.yamllint/rules.yml" nspanel_esphome_advanced.yaml
- name: Validate nspanel_esphome_addon_climate_cool.yaml
run: yamllint -c "./.yamllint/rules.yml" nspanel_esphome_addon_climate_cool.yaml
- name: Validate nspanel_esphome_addon_climate_heat.yaml
run: yamllint -c "./.yamllint/rules.yml" nspanel_esphome_addon_climate_heat.yaml

View File

@@ -18,19 +18,27 @@ substitutions:
#############################
external_components:
- source: github://pr#3256 # adds esp-idf support to http_request
components:
- http_request
- source: github://pr#5484 #5660 # adds exit reparse to Nextion library
# - source: github://pr#3256 # adds esp-idf support to http_request
# components:
# - http_request
- source: github://pr#5667 #5484 #5660 # adds exit reparse to Nextion library
components:
- nextion
refresh: 300s
# - source:
# type: git
# url: https://github.com/edwardtfn/esphome
# ref: nextion-esp-idf
# components:
# - nextion
# refresh: 1s
##### HTTP REQUEST #####
# Enables http client #
# for upload_tft. #
########################
http_request:
id: httpclient
#http_request:
# id: httpclient
button:
##### UPDATE TFT DISPLAY #####
@@ -69,21 +77,65 @@ api:
state: false
- lambda: 'id(upload_tft).execute(url.c_str());'
#display:
# - id: !extend disp1
# tft_url: ${nextion_update_url}
display:
- id: !extend disp1
tft_url: ${nextion_update_url}
script:
- id: upload_tft_new
- id: upload_tft
mode: single
parameters:
url: string
then:
- lambda: |-
static const char *const TAG = "script.upload_tft";
ESP_LOGD(TAG, "Starting...");
ESP_LOGVV(TAG, "Starting...");
ESP_LOGV(TAG, "Setting TFT url: %s", url.c_str());
id(disp1)->set_tft_url(url.c_str());
unsigned int upload_tries = 0;
while (upload_tries < 5) {
upload_tries++;
ESP_LOGD(TAG, "Try #%i", upload_tries);
ESP_LOGD(TAG, "Setting Nextion protocol reparse mode to passive");
id(disp1).set_protocol_reparse_mode(false);
ESP_LOGV(TAG, "Calling upload from Nextion component");
if (id(disp1)->upload_tft()) id(restart_nspanel).press();
ESP_LOGD(TAG, "Turn off Nextion");
id(screen_power).turn_off();
#ifdef ARDUINO
delay(1500);
#elif defined(ESP_PLATFORM)
vTaskDelay(pdMS_TO_TICKS(1500));
#endif
ESP_LOGD(TAG, "Turn on Nextion");
id(screen_power).turn_on();
#ifdef ARDUINO
delay(1500);
#elif defined(ESP_PLATFORM)
vTaskDelay(pdMS_TO_TICKS(1500));
#endif
}
ESP_LOGE(TAG, "TFT upload failed.");
ESP_LOGD(TAG, "Turn off Nextion");
id(screen_power).turn_off();
#ifdef ARDUINO
delay(1500);
#elif defined(ESP_PLATFORM)
vTaskDelay(pdMS_TO_TICKS(1500));
#endif
ESP_LOGD(TAG, "Turn on Nextion");
id(screen_power).turn_on();
ESP_LOGD(TAG, "Restarting esphome");
#ifdef ARDUINO
delay(1500);
#elif defined(ESP_PLATFORM)
vTaskDelay(pdMS_TO_TICKS(1500));
#endif
id(restart_nspanel).press();
ESP_LOGV(TAG, "Finished!");
- id: upload_tft
- id: upload_tft_legacy # Not in use - To be removed when Nextion component is updated
mode: single
parameters:
url: string