Merge pull request #343 from Blackymas/dev

update 3.1.1
This commit is contained in:
Blackymas
2023-02-14 16:10:28 +01:00
committed by GitHub
4 changed files with 671 additions and 510 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -161,7 +161,7 @@ api:
- 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 #####
- service: send_command_hide - service: send_command_hide ### unused ###
variables: variables:
component: string component: string
then: then:
@@ -170,7 +170,7 @@ api:
- 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 #####
- service: send_command_show - service: send_command_show ### unused ###
variables: variables:
component: string component: string
then: then:
@@ -229,6 +229,16 @@ api:
id(notification_text).publish_state(""); id(notification_text).publish_state("");
- switch.turn_off: notification_unread - switch.turn_off: notification_unread
##### Service to set entity-information for settings-page(s)
- service: set_settings_entity
variables:
entity: string
then:
- wait_until:
switch.is_on: nextion_init
- lambda: |-
id(settings_entity).publish_state(entity.c_str());
##### Service to play a rtttl tones ##### ##### Service to play a rtttl tones #####
# Example tones : https://codebender.cc/sketch:109888#RTTTL%20Songs.ino # Example tones : https://codebender.cc/sketch:109888#RTTTL%20Songs.ino
- service: play_rtttl - service: play_rtttl
@@ -338,18 +348,13 @@ binary_sensor:
###### LEFT BUTTON BELOW DISPLAY TO TOGGLE RELAY##### ###### LEFT BUTTON BELOW DISPLAY TO TOGGLE RELAY#####
- platform: gpio - platform: gpio
# name: ${device_name} Left Button name: ${device_name} Left Button
id: left_button id: left_button
pin: pin:
number: 14 number: 14
inverted: true inverted: true
on_click: on_click:
- min_length: 50ms
max_length: 1000ms
then: then:
- binary_sensor.template.publish:
id: left_button_short
state: ON
- if: - if:
condition: condition:
and: and:
@@ -365,50 +370,17 @@ binary_sensor:
switch.is_on: relay_1 switch.is_on: relay_1
then: then:
- lambda: id(disp1).send_command_printf("home.icon_top_01.pic=105"); - lambda: id(disp1).send_command_printf("home.icon_top_01.pic=105");
- delay: 500ms
- binary_sensor.template.publish:
id: left_button_short
state: OFF
on_press:
then:
- lambda: |-
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
ESP_LOGD("nspanel", "settingspage -> no press");
} else {
// ESP_LOGD("nspanel", "release button");
id(disp1_lastclick_general).set_state("pressbuttonleft",true,true);
}
on_release:
then:
- lambda: |-
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
ESP_LOGD("nspanel", "settingspage -> no release");
} else {
// ESP_LOGD("nspanel", "release button");
id(disp1_lastclick_general).set_state("releasebuttonleft",true,true);
}
- platform: template
name: ${device_name} Left Button
id: left_button_short
lambda: |-
return {};
##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY ##### ##### RIGHT BUTTON BELOW DISPLAY TO TOGGLE RELAY #####
- platform: gpio - platform: gpio
# name: ${device_name} Right Button name: ${device_name} Right Button
id: right_button id: right_button
pin: pin:
number: 27 number: 27
inverted: true inverted: true
on_click: on_click:
- min_length: 50ms
max_length: 1000ms
then: then:
- binary_sensor.template.publish:
id: right_button_short
state: ON
- if: - if:
condition: condition:
and: and:
@@ -424,34 +396,6 @@ binary_sensor:
switch.is_on: relay_2 switch.is_on: relay_2
then: then:
- lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106"); - lambda: id(disp1).send_command_printf("home.icon_top_02.pic=106");
- delay: 500ms
- binary_sensor.template.publish:
id: right_button_short
state: OFF
on_press:
then:
- lambda: |-
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
ESP_LOGD("nspanel", "settingspage -> no press");
} else {
// ESP_LOGD("nspanel", "release button");
id(disp1_lastclick_general).set_state("pressbuttonright",true,true);
}
on_release:
then:
- lambda: |-
if (id(disp1_currentpage).state == "lightsettings" or id(disp1_currentpage).state == "coversettings") {
ESP_LOGD("nspanel", "settingspage -> no release");
} else {
// ESP_LOGD("nspanel", "release button");
id(disp1_lastclick_general).set_state("releasebuttonright",true,true);
}
- platform: template
name: ${device_name} Right Button
id: right_button_short
lambda: |-
return {};
##### Restart NSPanel Button - Setting Page ##### ##### Restart NSPanel Button - Setting Page #####
- platform: nextion - platform: nextion
@@ -616,6 +560,10 @@ text_sensor:
name: ${device_name} Notification Text name: ${device_name} Notification Text
id: notification_text id: notification_text
- platform: template
name: ${device_name} Settings Entity
id: settings_entity
##### last click sensor, the main action variable - push to HA ##### ##### last click sensor, the main action variable - push to HA #####
- platform: nextion - platform: nextion
nextion_id: disp1 nextion_id: disp1
@@ -950,11 +898,11 @@ display:
on_setup: on_setup:
then: then:
- lambda: id(disp1).send_command_printf("page 8"); - lambda: id(disp1).send_command_printf("page 8");
- lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.1.0"); ### esphome-version ### - lambda: id(disp1).set_component_text_printf("boot.esph_version", "%s", "3.1.1"); ### esphome-version ###
- wait_until: - wait_until:
api.connected api.connected
- lambda: id(disp1).set_component_text_printf("boot.ip_addr", "%s", id(ip_address).state.c_str()); - lambda: id(disp1).set_component_text_printf("boot.ip_addr", "%s", id(ip_address).state.c_str());
- delay: 0.5s - delay: 1s
- number.set: - number.set:
id: display_brightness id: display_brightness
value: !lambda 'return id(display_brightness_global);' value: !lambda 'return id(display_brightness_global);'
@@ -967,7 +915,7 @@ display:
- lambda: id(disp1).send_command_printf("settings.dimslider.val=%i", id(display_dim_brightness_global)); - lambda: id(disp1).send_command_printf("settings.dimslider.val=%i", id(display_dim_brightness_global));
- lambda: id(disp1).send_command_printf("home.sleepmodus.val=%i", id(sleep_modus_global)); - lambda: id(disp1).send_command_printf("home.sleepmodus.val=%i", id(sleep_modus_global));
- lambda: id(disp1).set_component_value("settings.a02", id(sleep_modus_global) == 1); - lambda: id(disp1).set_component_value("settings.a02", id(sleep_modus_global) == 1);
- delay: 0.5s - delay: 1s
- switch.template.publish: - switch.template.publish:
id: nextion_init id: nextion_init
state: on state: on

Binary file not shown.

Binary file not shown.