mirror of
https://github.com/esphome/esphome.git
synced 2024-12-18 15:57:58 +01:00
Fix ESP8266 preference loading (#2367)
This commit is contained in:
parent
bbac1534a3
commit
c8a8acd46e
@ -149,7 +149,12 @@ class ESP8266PreferenceBackend : public ESPPreferenceBackend {
|
||||
return false;
|
||||
|
||||
uint32_t crc = calculate_crc(buffer.begin(), buffer.end() - 1, type);
|
||||
return buffer[buffer.size() - 1] == crc;
|
||||
if (buffer[buffer.size() - 1] != crc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
memcpy(data, buffer.data(), len);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user