1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-01 19:02:18 +01:00

Add get_size method to QR Code header (#6430)

This commit is contained in:
Daniel Eisterhold
2024-03-27 18:56:26 -05:00
committed by GitHub
parent 0ff543ffe5
commit 9194f7eb27
8 changed files with 56 additions and 0 deletions

View File

@@ -11,6 +11,13 @@ display:
cs_pin: 8
dc_pin: 9
reset_pin: 10
lambda: |-
// Draw a QR code in the center of the screen
auto scale = 2;
auto size = id(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(homepage_qr), Color(255,255,255), scale);
qr_code:
- id: homepage_qr

View File

@@ -11,6 +11,13 @@ display:
cs_pin: 8
dc_pin: 9
reset_pin: 10
lambda: |-
// Draw a QR code in the center of the screen
auto scale = 2;
auto size = id(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(homepage_qr), Color(255,255,255), scale);
qr_code:
- id: homepage_qr

View File

@@ -11,6 +11,13 @@ display:
cs_pin: 12
dc_pin: 13
reset_pin: 21
lambda: |-
// Draw a QR code in the center of the screen
auto scale = 2;
auto size = id(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(homepage_qr), Color(255,255,255), scale);
qr_code:
- id: homepage_qr

View File

@@ -11,6 +11,13 @@ display:
cs_pin: 12
dc_pin: 13
reset_pin: 21
lambda: |-
// Draw a QR code in the center of the screen
auto scale = 2;
auto size = id(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(homepage_qr), Color(255,255,255), scale);
qr_code:
- id: homepage_qr

View File

@@ -11,6 +11,13 @@ display:
cs_pin: 5
dc_pin: 15
reset_pin: 16
lambda: |-
// Draw a QR code in the center of the screen
auto scale = 2;
auto size = id(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(homepage_qr), Color(255,255,255), scale);
qr_code:
- id: homepage_qr

View File

@@ -11,6 +11,13 @@ display:
cs_pin: 20
dc_pin: 21
reset_pin: 22
lambda: |-
// Draw a QR code in the center of the screen
auto scale = 2;
auto size = id(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(homepage_qr), Color(255,255,255), scale);
qr_code:
- id: homepage_qr