mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	Add verbose logging for pulse width calculation in pulse_meter (#8124)
This commit is contained in:
		| @@ -75,6 +75,8 @@ void PulseMeterSensor::loop() { | |||||||
|       case MeterState::RUNNING: { |       case MeterState::RUNNING: { | ||||||
|         uint32_t delta_us = this->get_->last_detected_edge_us_ - this->last_processed_edge_us_; |         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_); |         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); |         this->publish_state((60.0f * 1000000.0f) / pulse_width_us); | ||||||
|       } break; |       } break; | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user