mirror of
https://github.com/esphome/esphome.git
synced 2025-01-30 23:02:14 +01:00
Add verbose logging for pulse width calculation in pulse_meter (#8124)
This commit is contained in:
parent
0c032bc431
commit
d4857a1727
@ -75,6 +75,8 @@ void PulseMeterSensor::loop() {
|
||||
case MeterState::RUNNING: {
|
||||
uint32_t delta_us = this->get_->last_detected_edge_us_ - this->last_processed_edge_us_;
|
||||
float pulse_width_us = delta_us / float(this->get_->count_);
|
||||
ESP_LOGV(TAG, "New pulse, delta: %" PRIu32 " µs, count: %" PRIu32 ", width: %.5f µs", delta_us,
|
||||
this->get_->count_, pulse_width_us);
|
||||
this->publish_state((60.0f * 1000000.0f) / pulse_width_us);
|
||||
} break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user