mirror of
https://github.com/esphome/esphome.git
synced 2025-07-29 06:36:45 +00:00
pulse_meter total (#9282)
This commit is contained in:
parent
84ab758b22
commit
785b14ac84
@ -31,6 +31,10 @@ void PulseMeterSensor::setup() {
|
|||||||
this->pulse_state_.latched_ = this->last_pin_val_;
|
this->pulse_state_.latched_ = this->last_pin_val_;
|
||||||
this->pin_->attach_interrupt(PulseMeterSensor::pulse_intr, this, gpio::INTERRUPT_ANY_EDGE);
|
this->pin_->attach_interrupt(PulseMeterSensor::pulse_intr, this, gpio::INTERRUPT_ANY_EDGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this->total_sensor_ != nullptr) {
|
||||||
|
this->total_sensor_->publish_state(this->total_pulses_);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PulseMeterSensor::loop() {
|
void PulseMeterSensor::loop() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user