mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-24 06:38:29 +02:00
Publish the pulse_meter total when setting the total (#5475)
This commit is contained in:
committed by
Jesse Hills
parent
11dba3147d
commit
76ab923780
@@ -7,6 +7,13 @@ namespace pulse_meter {
|
||||
|
||||
static const char *const TAG = "pulse_meter";
|
||||
|
||||
void PulseMeterSensor::set_total_pulses(uint32_t pulses) {
|
||||
this->total_pulses_ = pulses;
|
||||
if (this->total_sensor_ != nullptr) {
|
||||
this->total_sensor_->publish_state(this->total_pulses_);
|
||||
}
|
||||
}
|
||||
|
||||
void PulseMeterSensor::setup() {
|
||||
this->pin_->setup();
|
||||
this->isr_pin_ = pin_->to_isr();
|
||||
|
||||
Reference in New Issue
Block a user