1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-13 15:23:49 +01:00
Files
esphome/tests/components/qr_code/common.yaml
J. Nick Koston 0a862ad76a tweak
2025-10-08 20:19:16 -10:00

20 lines
579 B
YAML

display:
- platform: ili9xxx
id: qr_code_main_lcd
model: ili9342
cs_pin: ${cs_pin}
dc_pin: ${dc_pin}
reset_pin: ${reset_pin}
invert_colors: false
lambda: |-
// Draw a QR code in the center of the screen
auto scale = 2;
auto size = id(qr_code_homepage_qr).get_size() * scale;
auto x = (it.get_width() / 2) - (size / 2);
auto y = (it.get_height() / 2) - (size / 2);
it.qr_code(x, y, id(qr_code_homepage_qr), Color(255,255,255), scale);
qr_code:
- id: qr_code_homepage_qr
value: https://esphome.io/index.html