Add get_size method to QR Code header (#6430)

This commit is contained in:
Daniel Eisterhold authored and GitHub committed 2024-03-28 12:56:26 +13:00
1 parent 0ff543ffe5
commit 9194f7eb27
8 files changed
+56

No files matched your search

+12
View File
@@ -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