change temperaturesensor id to underscore notation

This commit is contained in:
MichaelDvP
2024-07-04 13:42:23 +02:00
parent 147804b4b8
commit cee2d5ca31
4 changed files with 15 additions and 9 deletions

View File

@@ -99,6 +99,10 @@ StateUpdateResult WebCustomization::update(JsonObject root, WebCustomization & c
sensor.id = sensorJson["id"].as<std::string>();
sensor.name = sensorJson["name"].as<std::string>();
sensor.offset = sensorJson["offset"];
if (sensor.id == sensor.name) {
sensor.name = ""; // no need to store id as name
}
std::replace(sensor.id.begin(), sensor.id.end(), '-', '_'); // change old ids to v3.7 style
customizations.sensorCustomizations.push_back(sensor); // add to list
}
}