Skip to content

Commit

Permalink
fix integration sensor (esphome#711)
Browse files Browse the repository at this point in the history
* fix integration sensor

* revert rtc_.save conditional
  • Loading branch information
glmnet authored and OttoWinter committed Aug 31, 2019
1 parent 9b28c73 commit 244c4be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion esphome/components/integration/integration_sensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ void IntegrationSensor::process_sensor_value_(float value) {
area = dt * new_value;
break;
}
this->publish_and_save_(this->last_value_ + area);
this->last_value_ = new_value;
this->last_update_ = now;
this->publish_and_save_(this->result_ + area);
}

} // namespace integration
Expand Down

0 comments on commit 244c4be

Please sign in to comment.