Add 'set_total_pulses' action to 'pulse_counter' sensor. (#3640)

This commit is contained in:
RoboMagus
2022-07-25 04:20:15 +02:00
committed by GitHub
parent f33d829ce9
commit 04f4dd8a22
4 changed files with 56 additions and 1 deletions
@@ -144,6 +144,11 @@ void PulseCounterSensor::setup() {
}
}
void PulseCounterSensor::set_total_pulses(uint32_t pulses) {
this->current_total_ = pulses;
this->total_sensor_->publish_state(pulses);
}
void PulseCounterSensor::dump_config() {
LOG_SENSOR("", "Pulse Counter", this);
LOG_PIN(" Pin: ", this->pin_);