some case and nullptr checks

This commit is contained in:
MichaelDvP
2023-03-04 17:42:14 +01:00
parent 0380fe1fff
commit b1c42b8d8f
4 changed files with 18 additions and 11 deletions

View File

@@ -404,7 +404,7 @@ bool DallasSensor::get_value_info(JsonObject & output, const char * cmd, const i
}
for (const auto & sensor : sensors_) {
if (strcmp(command_s, sensor.name().c_str()) == 0 || strcmp(command_s, sensor.id().c_str()) == 0) {
if (Helpers::toLower(command_s) == Helpers::toLower(sensor.name().c_str()) || Helpers::toLower(command_s) == Helpers::toLower(sensor.id().c_str())) {
output["id"] = sensor.id();
output["name"] = sensor.name();
char val[10];