mirror of
https://github.com/esphome/esphome.git
synced 2026-03-23 22:37:31 +08:00
[sgp30] Fix serial number truncation from 48-bit to 24-bit (#14478)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,9 @@ void SGP30Component::setup() {
|
||||
this->mark_failed();
|
||||
return;
|
||||
}
|
||||
this->serial_number_ = encode_uint24(raw_serial_number[0], raw_serial_number[1], raw_serial_number[2]);
|
||||
this->serial_number_ = (static_cast<uint64_t>(raw_serial_number[0]) << 32) |
|
||||
(static_cast<uint64_t>(raw_serial_number[1]) << 16) |
|
||||
static_cast<uint64_t>(raw_serial_number[2]);
|
||||
ESP_LOGD(TAG, "Serial number: %" PRIu64, this->serial_number_);
|
||||
|
||||
// Featureset identification for future use
|
||||
|
||||
Reference in New Issue
Block a user