add esphome display notes

This commit is contained in:
2025-11-18 09:57:49 -05:00
parent dc2df62d04
commit 91f4687c07

View File

@@ -25,6 +25,7 @@
- [light](#light) - [light](#light)
- [binary sensor](#binary-sensor) - [binary sensor](#binary-sensor)
- [lambda](#lambda) - [lambda](#lambda)
- [Display](#display)
## Install ## Install
@@ -177,3 +178,72 @@ assist_pipeline:
> you call any of ESPHomes many APIs directly. For example, here were > you call any of ESPHomes many APIs directly. For example, here were
> retrieving the current state of the end stop using .state and using it to > retrieving the current state of the end stop using .state and using it to
> construct our cover state. > construct our cover state.
### Display
Display pages
```yaml
display:
- platform: st7735
spi_id: spi_lcd
model: "INITR_MINI160X80"
reset_pin: GPIO1
cs_pin: GPIO4
dc_pin: GPIO2
rotation: 270
device_width: 82
device_height: 161
col_start: 0
row_start: 0
eight_bit_color: true
invert_colors: true
use_bgr: true
auto_clear_enabled: true
id: my_display
pages:
- id: page1
lambda: |-
it.print(0, 10, id(font_roboto), "Connecting to");
it.print(0, 30, id(font_roboto), "Home Assistant...");
- id: page2
lambda: |-
it.print(0, 10, id(font_roboto), "Configuring");
it.print(0, 30, id(font_roboto), "sensors...");
- id: page3
lambda: |-
it.print(0, 10, id(font_roboto), "Loading");
it.print(0, 30, id(font_roboto), "important");
it.print(0, 50, id(font_roboto), "update...");
- id: page4
lambda: |-
it.image(0, 0, id(my_image), COLOR_OFF, COLOR_ON);
```
Switch pages
```yaml
interval:
- interval: 5s
then:
- display.page.show_next: my_display
- component.update: my_display
```
Show an image
```yaml
image:
- file: "test_tdongle_image.png"
type: RGB
id: my_image
```
Specify a font
```yaml
font:
- file: "gfonts://Roboto"
id: font_roboto
size: 20
```