Optimize e-paper refresh behavior and make deprecated image logic future

proof.
This commit is contained in:
2026-07-16 16:52:28 +02:00
parent 5d4e8ef40c
commit e358c2cffe
+28 -4
View File
@@ -51,6 +51,13 @@ api:
# Include ArduinoJson support for the compact calendar event feed. # Include ArduinoJson support for the compact calendar event feed.
json: json:
# Prevent refreshes when Home Assistant republishes unchanged calendar data.
globals:
- id: last_rendered_calendar_entries
type: std::string
restore_value: no
initial_value: '""'
ota: ota:
platform: esphome platform: esphome
password: !secret ota password: !secret ota
@@ -222,6 +229,17 @@ text_sensor:
entity_id: sensor.epaper_kalenderdaten entity_id: sensor.epaper_kalenderdaten
attribute: entries attribute: entries
id: calendar_entries id: calendar_entries
on_value:
then:
- if:
condition:
and:
- display.is_displaying_page: calendar
- lambda: return x != id(last_rendered_calendar_entries);
then:
- lambda: id(last_rendered_calendar_entries) = x;
- component.update: epaper
# Home Assistant selects one quote per day from its local quote library. # Home Assistant selects one quote per day from its local quote library.
- platform: homeassistant - platform: homeassistant
@@ -243,13 +261,18 @@ time:
- output.turn_on: power_key - output.turn_on: power_key
- delay: 0.5s - delay: 0.5s
- output.turn_off: power_key - output.turn_off: power_key
# Every 10 minutes # Environmental readings need their regular refresh. Calendar updates are
# instead triggered by changed event data while that page is active.
- seconds: 0 - seconds: 0
minutes: /10 minutes: /10
then:
- if:
condition:
display.is_displaying_page: environment
then: then:
- logger.log: - logger.log:
level: INFO level: INFO
format: "Timer based screen refresh" format: "Timer based environment screen refresh"
- component.update: epaper - component.update: epaper
- seconds: 10 - seconds: 10
minutes: 0 minutes: 0
@@ -721,11 +744,12 @@ font:
] ]
image: image:
- file: "epaperframe/C1024_logo_flat_bw.png" - platform: file
file: "epaperframe/C1024_logo_flat_bw.png"
id: c1024_logo id: c1024_logo
type: binary type: binary
resize: 77x40 resize: 77x40
invert_alpha: True invert_alpha: true
spi: spi:
clk_pin: 23 clk_pin: 23