Merge branch 'loop_time_update_disable' into integration

This commit is contained in:
J. Nick Koston 2025-07-15 11:07:42 -10:00
commit 4c91dead3d
No known key found for this signature in database
2 changed files with 4 additions and 1 deletions

View File

@ -356,7 +356,7 @@ void MS8607Component::read_humidity_(float temperature_float) {
// map 16 bit humidity value into range [-6%, 118%] // map 16 bit humidity value into range [-6%, 118%]
float const humidity_partial = double(humidity) / (1 << 16); float const humidity_partial = double(humidity) / (1 << 16);
float const humidity_percentage = lerp(humidity_partial, -6.0, 118.0); float const humidity_percentage = std::lerp(-6.0, 118.0, humidity_partial);
float const compensated_humidity_percentage = float const compensated_humidity_percentage =
humidity_percentage + (20 - temperature_float) * MS8607_H_TEMP_COEFFICIENT; humidity_percentage + (20 - temperature_float) * MS8607_H_TEMP_COEFFICIENT;
ESP_LOGD(TAG, "Compensated for temperature, humidity=%.2f%%", compensated_humidity_percentage); ESP_LOGD(TAG, "Compensated for temperature, humidity=%.2f%%", compensated_humidity_percentage);

View File

@ -320,6 +320,9 @@ void Application::disable_component_loop_(Component *component) {
if (this->in_loop_ && i == this->current_loop_index_) { if (this->in_loop_ && i == this->current_loop_index_) {
// Decrement so we'll process the swapped component next // Decrement so we'll process the swapped component next
this->current_loop_index_--; this->current_loop_index_--;
// Update the loop start time to current time so the swapped component
// gets correct timing instead of inheriting stale timing
this->loop_component_start_time_ = millis();
} }
} }
return; return;