change esphome lastclick

This commit is contained in:
Blackymas
2022-11-07 22:12:55 +01:00
parent 577985f283
commit 3ee83a1646
2 changed files with 56 additions and 21 deletions

View File

@@ -278,25 +278,25 @@ globals:
initial_value: '0'
##### lastclick State #####
- id: lastclick_global
- id: lastclick_general_global
type: std::string
restore_value: no
initial_value: ''
##### lastclick State #####
- id: last_click_lightsettings
- id: lastclick_lightsettings_global
type: std::string
restore_value: no
initial_value: ''
##### lastclick State #####
- id: last_click_coversettings
- id: lastclick_coversettings_global
type: std::string
restore_value: no
initial_value: ''
##### lastclick State #####
- id: last_click_weathersettings
- id: lastclick_climatesettings_global
type: std::string
restore_value: no
initial_value: ''
@@ -777,13 +777,13 @@ text_sensor:
- platform: nextion
nextion_id: disp1
name: ${device_name} Last Click
id: disp1_last_click_nextion
id: disp1_lastclick_general
update_interval: 50ms
component_name: lastclick
internal: false
filters:
- lambda: |-
if (strcmp(x.c_str(), id(lastclick_global).c_str()) != 0) {
if (strcmp(x.c_str(), id(lastclick_general_global).c_str()) != 0) {
return x;
} else {
return {};
@@ -791,20 +791,20 @@ text_sensor:
on_value:
then:
- globals.set:
id: lastclick_global
id: lastclick_general_global
value: !lambda return x;
##### last click lightsettings page, the main action variable - push to HA #####
- platform: nextion
nextion_id: disp1
name: ${device_name} last click lightsettings
id: disp1_last_click_lightsettings
id: disp1_lastclick_lightsettings
update_interval: 50ms
component_name: lightsetting
internal: false
filters:
- lambda: |-
if (strcmp(x.c_str(), id(last_click_lightsettings).c_str()) != 0) {
if (strcmp(x.c_str(), id(lastclick_lightsettings_global).c_str()) != 0) {
return x;
} else {
return {};
@@ -812,20 +812,20 @@ text_sensor:
on_value:
then:
- globals.set:
id: last_click_lightsettings
id: lastclick_lightsettings_global
value: !lambda return x;
##### last click coversettings page, the main action variable - push to HA #####
- platform: nextion
nextion_id: disp1
name: ${device_name} last click coversettings
id: disp1_last_click_coversettings
id: disp1_lastclick_coversettings
update_interval: 50ms
component_name: coversetting
internal: false
filters:
- lambda: |-
if (strcmp(x.c_str(), id(last_click_coversettings).c_str()) != 0) {
if (strcmp(x.c_str(), id(lastclick_coversettings_global).c_str()) != 0) {
return x;
} else {
return {};
@@ -833,20 +833,20 @@ text_sensor:
on_value:
then:
- globals.set:
id: last_click_coversettings
id: lastclick_coversettings_global
value: !lambda return x;
##### last click weather page, the main action variable - push to HA #####
##### last click climate page, the main action variable - push to HA #####
- platform: nextion
nextion_id: disp1
name: ${device_name} last click weathersettings
id: disp1_last_click_weathersettings
id: disp1_lastclick_climatesettings
update_interval: 50ms
component_name: weathersetting
internal: false
filters:
- lambda: |-
if (strcmp(x.c_str(), id(last_click_weathersettings).c_str()) != 0) {
if (strcmp(x.c_str(), id(lastclick_climatesettings_global).c_str()) != 0) {
return x;
} else {
return {};
@@ -854,7 +854,7 @@ text_sensor:
on_value:
then:
- globals.set:
id: last_click_weathersettings
id: lastclick_climatesettings_global
value: !lambda return x;
##### HEATING System ICON #####