Check if hasSensor an run if not initialized (#2613)

This commit is contained in:
Ben Meadors 2023-07-16 15:23:31 -05:00 committed by GitHub
parent 6d97d5dfa2
commit e4e26a819b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,6 +86,10 @@ int32_t EnvironmentTelemetryModule::runOnce()
result = lps22hbSensor.runOnce();
if (sht31Sensor.hasSensor())
result = sht31Sensor.runOnce();
if (ina219Sensor.hasSensor() && !ina219Sensor.isInitialized())
result = ina219Sensor.runOnce();
if (ina260Sensor.hasSensor() && !ina260Sensor.isInitialized())
result = ina260Sensor.runOnce();
}
return result;
} else {