Add get_size method to QR Code header (#6430)
This commit is contained in:
1 parent
0ff543ffe5
commit
9194f7eb27
8 files changed
+56
No files matched your search
@@ -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