refactor: optimizations & fixes

This commit is contained in:
Yurii
2024-11-11 15:45:36 +03:00
parent 24a46f4c16
commit c6df74f06e
9 changed files with 244 additions and 205 deletions

View File

@@ -1461,7 +1461,8 @@ bool jsonToSensorSettings(const uint8_t sensorId, const JsonVariantConst src, Se
// name
if (!src[FPSTR(S_NAME)].isNull()) {
String value = Sensors::cleanName(src[FPSTR(S_NAME)].as<String>());
auto value = src[FPSTR(S_NAME)].as<String>();
Sensors::cleanName(value);
if (value.length() < sizeof(dst.name) && !value.equals(dst.name)) {
strcpy(dst.name, value.c_str());