Removed display_current_brightness
I've removed this sensor as it was spamming the logs and taking memory without providing real benefit.
This commit is contained in:
@@ -1072,15 +1072,6 @@ sensor:
|
||||
# Show panel's temperature if API or Wi-Fi are out
|
||||
- lambda: id(display_embedded_temp).execute();
|
||||
|
||||
- name: ${device_name} Brightness
|
||||
id: display_current_brightness
|
||||
platform: nextion
|
||||
variable_name: dim
|
||||
internal: true
|
||||
icon: mdi:tablet-dashboard
|
||||
unit_of_measurement: '%'
|
||||
accuracy_decimals : 0
|
||||
|
||||
###### Display Brightness GET VALUE FROM NSPanel SLIDER #####
|
||||
- name: ${device_name} brightness Slider
|
||||
platform: nextion
|
||||
@@ -1094,7 +1085,6 @@ sensor:
|
||||
value: !lambda 'return int(x);'
|
||||
- lambda: |-
|
||||
id(timer_reset_all).execute("settings");
|
||||
id(display_current_brightness).update();
|
||||
|
||||
###### Display DIM Brightness GET VALUE FROM NSPanel SLIDER #####
|
||||
- name: ${device_name} dim brightness slider
|
||||
@@ -1109,7 +1099,6 @@ sensor:
|
||||
value: !lambda 'return int(x);'
|
||||
- lambda: |-
|
||||
id(timer_reset_all).execute("settings");
|
||||
id(display_current_brightness).update();
|
||||
|
||||
##### START - TEXT SENSOR CONFIGURATION #####
|
||||
text_sensor:
|
||||
@@ -1136,7 +1125,6 @@ text_sensor:
|
||||
ESP_LOGD("text_sensor.current_page", "New page: %s", x.c_str());
|
||||
if (!id(entity_id).empty()) ESP_LOGD("text_sensor.current_page", "Entity shown: %s", id(entity_id).c_str());
|
||||
id(timer_reset_all).execute(x.c_str());
|
||||
id(display_current_brightness).update();
|
||||
|
||||
##### ESPhome version used to compile the app #####
|
||||
- name: ${device_name} ESPhome Version
|
||||
@@ -1553,7 +1541,6 @@ number:
|
||||
id(disp1).send_command_printf("settings.brightslider.val=%i", int(x));
|
||||
if (id(current_page).state != "screensaver") id(disp1).set_backlight_brightness(x/100);
|
||||
if (id(current_page).state == "settings") id(disp1).set_component_text_printf("bright_text", "%i%%", int(x));
|
||||
id(display_current_brightness).update();
|
||||
|
||||
##### SCREEN BRIGHTNESS DIMMED DOWN #####
|
||||
- platform: template
|
||||
@@ -1636,6 +1623,7 @@ number:
|
||||
set_action:
|
||||
- lambda: id(timer_sleep).execute(id(current_page).state.c_str(), int(x));
|
||||
|
||||
##### START - SELECT CONFIGURATION #####
|
||||
select:
|
||||
- id: wakeup_page_name
|
||||
name: ${device_name} Wake-up page
|
||||
@@ -1753,7 +1741,6 @@ script:
|
||||
then:
|
||||
- lambda: |-
|
||||
ESP_LOGV("script.timer_dim", "Reset timer: %is", timeout);
|
||||
id(display_current_brightness).update();
|
||||
if (id(is_dim_brightness))
|
||||
{
|
||||
if (page != "screensaver" and page != "boot")
|
||||
@@ -1763,21 +1750,18 @@ script:
|
||||
}
|
||||
id(is_dim_brightness) = false;
|
||||
}
|
||||
id(display_current_brightness).update();
|
||||
- if:
|
||||
condition:
|
||||
- lambda: !lambda return (timeout >= 1);
|
||||
then:
|
||||
- delay: !lambda return (timeout *1000);
|
||||
- lambda: |-
|
||||
id(display_current_brightness).update();
|
||||
if (id(current_page).state != "screensaver" and id(current_page).state != "boot" and timeout >= 1 and id(display_current_brightness).state > id(display_dim_brightness_global))
|
||||
if (id(current_page).state != "screensaver" and id(current_page).state != "boot" and timeout >= 1)
|
||||
{
|
||||
ESP_LOGD("script.timer_dim", "Dimming the display to %i%%", id(display_dim_brightness_global));
|
||||
id(disp1).send_command_printf("dim=%i", id(display_dim_brightness_global));
|
||||
id(is_dim_brightness) = true;
|
||||
}
|
||||
id(display_current_brightness).update();
|
||||
- id: timer_sleep # Handle the sleep (go to screensaver page) after a timeout
|
||||
mode: restart
|
||||
parameters:
|
||||
|
||||
Reference in New Issue
Block a user