correction in temp code

This commit is contained in:
Justin E. Mann 2025-05-05 16:31:13 -06:00
parent 3f2dd953f1
commit 171ea1bfd0

View File

@ -110,14 +110,15 @@ bool RAK12035Sensor::getMetrics(meshtastic_Telemetry *measurement)
measurement->variant.environment_metrics.soil_temperature = (float)(temp / 10);
measurement->variant.environment_metrics.soil_moisture = moisture;
// temp code to get the values to the gui. will remove this once at least one of the clients is updated to use the new proto
// TODO:: remove this once the clients are updated to use the new proto
// temp code to get the values to the gui. will remove this once at least one of the clients is updated to use the new proto
if (!measurement->variant.environment_metrics.has_temperature && measurement->variant.environment_metrics.temperature == 0)
{
measurement->variant.environment_metrics.has_temperature = true;
measurement->variant.environment_metrics.temperature = measurement->variant.environment_metrics.soil_temperature;
}
if (measurement->variant.environment_metrics.relative_humidity == 0 && measurement->variant.environment_metrics.has_relative_humidity)
if (!measurement->variant.environment_metrics.has_relative_humidity && measurement->variant.environment_metrics.relative_humidity == 0)
{
measurement->variant.environment_metrics.has_relative_humidity = true;
measurement->variant.environment_metrics.relative_humidity = measurement->variant.environment_metrics.soil_moisture;