Skip to content

Commit f3a196d

Browse files
committed
[P077] Add cseclearpulses command to reset CF pulses counter
As requested on the [forum](https://www.letscontrolit.com/forum/viewtopic.php?t=10006)
1 parent a873019 commit f3a196d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

docs/source/Plugin/P077_commands.repl

+7
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,10 @@
2424
","
2525
Will reset the calibration values to the default values, causing auto-calibration.
2626
"
27+
"
28+
``cseclearpulses``
29+
30+
","
31+
(Added: 2024-01-16)
32+
Will reset the CF-pulse counter.
33+
"

src/src/PluginStructs/P077_data_struct.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,10 @@ bool P077_data_struct::plugin_write(struct EventStruct *event,
353353
P077_PREF = CSE_PREF_PULSE;
354354
success = true;
355355
changed = true;
356+
} else if (equals(cmd, F("cseclearpulses"))) {
357+
// Clear the pulses count
358+
last_cf_pulses = 0;
359+
cf_pulses = 0;
356360
} else if (equals(cmd, F("csecalibrate"))) { // Set 1 or more calibration values, 0 will skip that value
357361
success = true;
358362
float CalibVolt = 0.0f;

0 commit comments

Comments
 (0)