Fix change brightness when sleeping

Prevents the panel to change screen brightness when sleeping.

Solves #975
This commit is contained in:
Edward Firmo
2023-08-09 23:53:36 +02:00
parent 62bdb576ab
commit e98ca4c8d4

View File

@@ -1175,6 +1175,17 @@ number:
restore_value: true restore_value: true
optimistic: true optimistic: true
set_action: set_action:
then:
- if:
condition:
- binary_sensor.is_on: nextion_init
then:
- if:
condition:
- not:
- text_sensor.state: # Is sleeping?
id: current_page
state: 'screensaver'
then: then:
- lambda: 'id(disp1).set_backlight_brightness(x/100);' - lambda: 'id(disp1).set_backlight_brightness(x/100);'
- lambda: 'id(disp1).send_command_printf("home.brightness.val=%i", int(x));' - lambda: 'id(disp1).send_command_printf("home.brightness.val=%i", int(x));'