mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-30 17:58:27 +02:00
Add 'set_total_pulses' action to 'pulse_counter' sensor. (#3640)
This commit is contained in:
@@ -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_);
|
||||
|
||||
Reference in New Issue
Block a user