Compare commits
8 Commits
58132cb189
...
94db496d30
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
94db496d30 | ||
|
|
5a782bbe45 | ||
|
|
a80a2b7985 | ||
|
|
53e4dd7b81 | ||
|
|
955a7fbd8b | ||
|
|
9fa172ef36 | ||
|
|
ffce653d16 | ||
|
|
852ba63038 |
104
.github/workflows/validate_esphome.yml
vendored
Normal file
104
.github/workflows/validate_esphome.yml
vendored
Normal 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"
|
||||||
42
.github/workflows/validate_esphome_build.yml
vendored
42
.github/workflows/validate_esphome_build.yml
vendored
@@ -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"
|
|
||||||
|
|
||||||
25
.github/workflows/validate_esphome_yaml.yml
vendored
25
.github/workflows/validate_esphome_yaml.yml
vendored
@@ -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
|
|
||||||
@@ -18,19 +18,27 @@ substitutions:
|
|||||||
#############################
|
#############################
|
||||||
|
|
||||||
external_components:
|
external_components:
|
||||||
- source: github://pr#3256 # adds esp-idf support to http_request
|
# - source: github://pr#3256 # adds esp-idf support to http_request
|
||||||
components:
|
# components:
|
||||||
- http_request
|
# - http_request
|
||||||
- source: github://pr#5484 #5660 # adds exit reparse to Nextion library
|
- source: github://pr#5667 #5484 #5660 # adds exit reparse to Nextion library
|
||||||
components:
|
components:
|
||||||
- nextion
|
- nextion
|
||||||
|
refresh: 300s
|
||||||
|
# - source:
|
||||||
|
# type: git
|
||||||
|
# url: https://github.com/edwardtfn/esphome
|
||||||
|
# ref: nextion-esp-idf
|
||||||
|
# components:
|
||||||
|
# - nextion
|
||||||
|
# refresh: 1s
|
||||||
|
|
||||||
##### HTTP REQUEST #####
|
##### HTTP REQUEST #####
|
||||||
# Enables http client #
|
# Enables http client #
|
||||||
# for upload_tft. #
|
# for upload_tft. #
|
||||||
########################
|
########################
|
||||||
http_request:
|
#http_request:
|
||||||
id: httpclient
|
# id: httpclient
|
||||||
|
|
||||||
button:
|
button:
|
||||||
##### UPDATE TFT DISPLAY #####
|
##### UPDATE TFT DISPLAY #####
|
||||||
@@ -69,21 +77,65 @@ api:
|
|||||||
state: false
|
state: false
|
||||||
- lambda: 'id(upload_tft).execute(url.c_str());'
|
- lambda: 'id(upload_tft).execute(url.c_str());'
|
||||||
|
|
||||||
#display:
|
display:
|
||||||
# - id: !extend disp1
|
- id: !extend disp1
|
||||||
# tft_url: ${nextion_update_url}
|
tft_url: ${nextion_update_url}
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- id: upload_tft_new
|
- id: upload_tft
|
||||||
mode: single
|
mode: single
|
||||||
parameters:
|
parameters:
|
||||||
url: string
|
url: string
|
||||||
then:
|
then:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
static const char *const TAG = "script.upload_tft";
|
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
|
mode: single
|
||||||
parameters:
|
parameters:
|
||||||
url: string
|
url: string
|
||||||
|
|||||||
Reference in New Issue
Block a user