Add validation actions (#693)
* Add validation action * Clean-up yaml Removed trailing spaces * Clean-up yaml Removed trailing spaces * Clean-up yaml Removed trailing spaces * Clean-up yaml Removed trailing spaces * Clean-up yaml Removed trailing spaces * Update validate_yaml.yml * Validate on push Only for nspanel_esphome.yaml and nspanel_blueprint.yaml * Extending warnings for +255-char lines * Update validate_yaml.yml * Clean-up yaml * Update validate_yaml.yml * Clean-up yaml * Clean-up yaml * Clean-up yaml * Clean-up yaml * Clean-up yaml * Update and rename validate_yaml.yml to validate_blueprint.yml * Create validate_esphome.yml * Clean-up yaml
This commit is contained in:
19
.github/workflows/validate_blueprint.yml
vendored
Normal file
19
.github/workflows/validate_blueprint.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Validate Blueprint YAML
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "nspanel_blueprint.yaml"
|
||||||
|
pull_request:
|
||||||
|
#schedule:
|
||||||
|
# - cron: "0 0 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
code_scan:
|
||||||
|
name: Validate Blueprint YAML
|
||||||
|
runs-on: "ubuntu-latest"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Validate nspanel_blueprint.yaml
|
||||||
|
run: yamllint -c "./.yamllint/rules.yml" nspanel_blueprint.yaml
|
||||||
19
.github/workflows/validate_esphome.yml
vendored
Normal file
19
.github/workflows/validate_esphome.yml
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
name: Validate ESPHome YAML
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "nspanel_esphome.yaml"
|
||||||
|
pull_request:
|
||||||
|
#schedule:
|
||||||
|
# - cron: "0 0 * * *"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
code_scan:
|
||||||
|
name: Validate Blueprint YAML
|
||||||
|
runs-on: "ubuntu-latest"
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Validate nspanel_esphome.yaml
|
||||||
|
run: yamllint -c "./.yamllint/rules.yml" nspanel_esphome.yaml
|
||||||
7
.yamllint/rules.yml
Normal file
7
.yamllint/rules.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
extends: relaxed
|
||||||
|
|
||||||
|
rules:
|
||||||
|
# 255 chars should be enough, but don't fail if a line is longer
|
||||||
|
line-length:
|
||||||
|
max: 255
|
||||||
|
level: warning
|
||||||
@@ -4,7 +4,7 @@ climate:
|
|||||||
name: NSPanel Büro
|
name: NSPanel Büro
|
||||||
heater: switch.nspanel_buro_relay_2
|
heater: switch.nspanel_buro_relay_2
|
||||||
target_sensor: sensor.nspanel_buro_temperature
|
target_sensor: sensor.nspanel_buro_temperature
|
||||||
min_temp: 13
|
min_temp: 13
|
||||||
max_temp: 27
|
max_temp: 27
|
||||||
ac_mode: false
|
ac_mode: false
|
||||||
target_temp: 22
|
target_temp: 22
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Please insert into the default file "configuration.yaml
|
# Please insert into the default file "configuration.yaml"
|
||||||
# Folder must be changed to the directory where the tft file (Nextion Editor) will be uploaded
|
# Folder must be changed to the directory where the tft file (Nextion Editor) will be uploaded
|
||||||
###########
|
###########
|
||||||
#
|
#
|
||||||
#Folder watcher for NS panel auto upload tft
|
#Folder watcher for NS panel auto upload tft
|
||||||
folder_watcher:
|
folder_watcher:
|
||||||
- folder: /config/www/nspanel/
|
- folder: /config/www/nspanel/
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ sensor:
|
|||||||
{% set days = ['Montag,', 'Dienstag,', 'Mittwoch,', 'Donnerstag,', 'Freitag,', 'Samstag,', 'Sonntag,', 'Montag,'] %}
|
{% set days = ['Montag,', 'Dienstag,', 'Mittwoch,', 'Donnerstag,', 'Freitag,', 'Samstag,', 'Sonntag,', 'Montag,'] %}
|
||||||
{{(as_timestamp(now())+ (86400)) | timestamp_custom(days[now().weekday()+1] ~ ' %d.%m') }}
|
{{(as_timestamp(now())+ (86400)) | timestamp_custom(days[now().weekday()+1] ~ ' %d.%m') }}
|
||||||
icon_template: mdi:calendar-range
|
icon_template: mdi:calendar-range
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
sensors:
|
sensors:
|
||||||
wochentag02:
|
wochentag02:
|
||||||
@@ -75,4 +75,4 @@ sensor:
|
|||||||
nspanel_lea_target_temp:
|
nspanel_lea_target_temp:
|
||||||
unique_id: e8e61ff7-3a41-47ad-bd6c-303f730de96f
|
unique_id: e8e61ff7-3a41-47ad-bd6c-303f730de96f
|
||||||
friendly_name: NSPanel Lea Target Temp
|
friendly_name: NSPanel Lea Target Temp
|
||||||
value_template: "{{ state_attr('climate.nspanel_lea', 'temperature') }}"
|
value_template: "{{ state_attr('climate.nspanel_lea', 'temperature') }}"
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -186,7 +186,7 @@ api:
|
|||||||
message: string
|
message: string
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: 'id(disp1).set_component_text_printf(component.c_str(), "%s", message.c_str());'
|
- lambda: 'id(disp1).set_component_text_printf(component.c_str(), "%s", message.c_str());'
|
||||||
|
|
||||||
##### Service to send a command "component_value (Dualstate Button)" directly to the display #####
|
##### Service to send a command "component_value (Dualstate Button)" directly to the display #####
|
||||||
@@ -196,7 +196,7 @@ api:
|
|||||||
message: int
|
message: int
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: 'id(disp1).set_component_value(component.c_str(), message);'
|
- lambda: 'id(disp1).set_component_value(component.c_str(), message);'
|
||||||
|
|
||||||
##### Service to send a command "hide componente" directly to the display #####
|
##### Service to send a command "hide componente" directly to the display #####
|
||||||
@@ -205,7 +205,7 @@ api:
|
|||||||
component: string
|
component: string
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: 'id(disp1).hide_component(component.c_str());'
|
- lambda: 'id(disp1).hide_component(component.c_str());'
|
||||||
|
|
||||||
##### Service to send a command "show componente" directly to the display #####
|
##### Service to send a command "show componente" directly to the display #####
|
||||||
@@ -214,14 +214,14 @@ api:
|
|||||||
component: string
|
component: string
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: 'id(disp1).show_component(component.c_str());'
|
- lambda: 'id(disp1).show_component(component.c_str());'
|
||||||
|
|
||||||
##### Service to send a command "show ALL componente" directly to the display #####
|
##### Service to send a command "show ALL componente" directly to the display #####
|
||||||
- service: send_command_show_all ### unused ###
|
- service: send_command_show_all ### unused ###
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: 'id(disp1).show_component("255");'
|
- lambda: 'id(disp1).show_component("255");'
|
||||||
|
|
||||||
##### Service to send a command "font color" directly to the display #####
|
##### Service to send a command "font color" directly to the display #####
|
||||||
@@ -231,7 +231,7 @@ api:
|
|||||||
message: int
|
message: int
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: 'id(disp1).set_component_font_color(component.c_str(), message);'
|
- lambda: 'id(disp1).set_component_font_color(component.c_str(), message);'
|
||||||
|
|
||||||
##### Service to send a command "background color" directly to the display #####
|
##### Service to send a command "background color" directly to the display #####
|
||||||
@@ -241,7 +241,7 @@ api:
|
|||||||
message: int
|
message: int
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: 'id(disp1).set_component_background_color(component.c_str(), message);'
|
- lambda: 'id(disp1).set_component_background_color(component.c_str(), message);'
|
||||||
|
|
||||||
##### Service to show a notification-message on the screen #####
|
##### Service to show a notification-message on the screen #####
|
||||||
@@ -251,7 +251,7 @@ api:
|
|||||||
text: string
|
text: string
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(disp1).send_command_printf("page notification");
|
id(disp1).send_command_printf("page notification");
|
||||||
id(disp1).set_component_text_printf("notification.notifi_label", "%s", label.c_str());
|
id(disp1).set_component_text_printf("notification.notifi_label", "%s", label.c_str());
|
||||||
@@ -269,7 +269,7 @@ api:
|
|||||||
- service: notification_clear
|
- service: notification_clear
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(notification_label).publish_state("");
|
id(notification_label).publish_state("");
|
||||||
id(notification_text).publish_state("");
|
id(notification_text).publish_state("");
|
||||||
@@ -300,7 +300,7 @@ api:
|
|||||||
qrdata: string
|
qrdata: string
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(disp1).send_command_printf("page qrcode");
|
id(disp1).send_command_printf("page qrcode");
|
||||||
id(disp1).set_component_text_printf("qrcode.qrcode_value", "%s", qrdata.c_str());
|
id(disp1).set_component_text_printf("qrcode.qrcode_value", "%s", qrdata.c_str());
|
||||||
@@ -311,7 +311,7 @@ api:
|
|||||||
value: float
|
value: float
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
//ESP_LOGD("nextion", "thermostat sendig value %f", value);
|
//ESP_LOGD("nextion", "thermostat sendig value %f", value);
|
||||||
int v = int(2 * std::min(std::max(value - 13.5, 0.0), 5.0));
|
int v = int(2 * std::min(std::max(value - 13.5, 0.0), 5.0));
|
||||||
@@ -345,7 +345,7 @@ api:
|
|||||||
btn_bri_txt: string
|
btn_bri_txt: string
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
// ESP_LOGD("nextion", "set button %s", btn_id.c_str());
|
// ESP_LOGD("nextion", "set button %s", btn_id.c_str());
|
||||||
std::string btnicon = btn_id.c_str() + std::string("icon");
|
std::string btnicon = btn_id.c_str() + std::string("icon");
|
||||||
@@ -375,7 +375,7 @@ api:
|
|||||||
ent_value: string
|
ent_value: string
|
||||||
then:
|
then:
|
||||||
- wait_until:
|
- wait_until:
|
||||||
switch.is_on: nextion_init
|
switch.is_on: nextion_init
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
// ESP_LOGD("nextion", "set entity %s", ent_id.c_str());
|
// ESP_LOGD("nextion", "set entity %s", ent_id.c_str());
|
||||||
std::string enticon = ent_id.c_str() + std::string("_pic");
|
std::string enticon = ent_id.c_str() + std::string("_pic");
|
||||||
@@ -429,12 +429,12 @@ binary_sensor:
|
|||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
and:
|
and:
|
||||||
- switch.is_on: relay1_fallback
|
- switch.is_on: relay1_fallback
|
||||||
- not:
|
- not:
|
||||||
api.connected:
|
api.connected:
|
||||||
then:
|
then:
|
||||||
- switch.toggle: relay_1
|
- switch.toggle: relay_1
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
switch.is_on: relay_1
|
switch.is_on: relay_1
|
||||||
then:
|
then:
|
||||||
@@ -457,12 +457,12 @@ binary_sensor:
|
|||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
and:
|
and:
|
||||||
- switch.is_on: relay2_fallback
|
- switch.is_on: relay2_fallback
|
||||||
- not:
|
- not:
|
||||||
api.connected:
|
api.connected:
|
||||||
then:
|
then:
|
||||||
- switch.toggle: relay_2
|
- switch.toggle: relay_2
|
||||||
- if:
|
- if:
|
||||||
condition:
|
condition:
|
||||||
switch.is_on: relay_2
|
switch.is_on: relay_2
|
||||||
then:
|
then:
|
||||||
@@ -744,15 +744,15 @@ switch:
|
|||||||
on_turn_off:
|
on_turn_off:
|
||||||
- lambda: id(disp1).send_command_printf("home.sleepmodus.val=0");
|
- lambda: id(disp1).send_command_printf("home.sleepmodus.val=0");
|
||||||
- globals.set:
|
- globals.set:
|
||||||
id: sleep_modus_global
|
id: sleep_modus_global
|
||||||
value: '0'
|
value: '0'
|
||||||
- lambda: id(disp1).set_component_value("settings.bt1",0);
|
- lambda: id(disp1).set_component_value("settings.bt1",0);
|
||||||
on_turn_on:
|
on_turn_on:
|
||||||
- lambda: id(disp1).send_command_printf("home.sleepmodus.val=1");
|
- lambda: id(disp1).send_command_printf("home.sleepmodus.val=1");
|
||||||
- globals.set:
|
- globals.set:
|
||||||
id: sleep_modus_global
|
id: sleep_modus_global
|
||||||
value: '1'
|
value: '1'
|
||||||
- lambda: id(disp1).set_component_value("settings.bt1",1);
|
- lambda: id(disp1).set_component_value("settings.bt1",1);
|
||||||
|
|
||||||
##### Relay Local control Fallback #####
|
##### Relay Local control Fallback #####
|
||||||
- platform: template
|
- platform: template
|
||||||
|
|||||||
Reference in New Issue
Block a user