fixes for device_info

This commit is contained in:
proddy
2024-07-11 16:29:37 +02:00
parent 76675c79fb
commit d7ba360483
12 changed files with 59 additions and 55 deletions

View File

@@ -705,18 +705,14 @@ bool AnalogSensor::get_value_info(JsonObject output, const char * cmd, const int
output["api_data"] = data;
return true;
} else {
char error[100];
snprintf(error, sizeof(error), "cannot find attribute %s in entity %s", attribute_s, sensor_name);
output.clear();
output["message"] = error;
return false;
return EMSESP::return_not_found(output, "attribute", sensor_name); // not found
}
}
return true; // found a match, exit
}
}
return false; // not found
return EMSESP::return_not_found(output, "analog sensor", cmd); // not found
}
void AnalogSensor::addSensorJson(JsonObject output, const Sensor & sensor) {