mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-19 20:53:26 +02:00
Add get_size method to QR Code header (#6430)
This commit is contained in:
committed by
GitHub
parent
0ff543ffe5
commit
9194f7eb27
@@ -51,5 +51,17 @@ void QrCode::draw(display::Display *buff, uint16_t x_offset, uint16_t y_offset,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t QrCode::get_size() {
|
||||
if (this->needs_update_) {
|
||||
this->generate_qr_code();
|
||||
this->needs_update_ = false;
|
||||
}
|
||||
|
||||
uint8_t size = qrcodegen_getSize(this->qr_);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
} // namespace qr_code
|
||||
} // namespace esphome
|
||||
|
||||
Reference in New Issue
Block a user