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

@@ -580,7 +580,7 @@ bool AnalogSensor::get_value_info(JsonObject & output, const char * cmd, const i
}
for (const auto & sensor : sensors_) {
if (strcmp(command_s, sensor.name().c_str()) == 0 || Helpers::atoint(command_s) == sensor.gpio()) {
if (Helpers::toLower(command_s) == Helpers::toLower(sensor.name().c_str()) || Helpers::atoint(command_s) == sensor.gpio()) {
output["gpio"] = sensor.gpio();
output["name"] = sensor.name();
output["type"] = F_(number);