Skip to content

Commit

Permalink
Flag some sensors and transforms to require restart
Browse files Browse the repository at this point in the history
  • Loading branch information
mairas committed Aug 12, 2024
1 parent a150993 commit ffa69c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/sensesp/sensors/digital_input.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class DigitalInputState : public DigitalInput, public Sensor<bool> {
Sensor<bool>(config_path),
read_delay_{read_delay},
triggered_{false} {
set_requires_restart(true);
load_configuration();

ReactESP::app->onRepeat(read_delay_, [this]() { emit(digitalRead(pin_)); });
Expand Down
1 change: 1 addition & 0 deletions src/sensesp/transforms/median.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace sensesp {

Median::Median(unsigned int sample_size, String config_path)
: FloatTransform(config_path), sample_size_{sample_size} {
set_requires_restart(true);
load_configuration();
buf_.reserve(sample_size_);
buf_.clear();
Expand Down
1 change: 1 addition & 0 deletions src/sensesp/transforms/moving_average.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ MovingAverage::MovingAverage(int sample_size, float multiplier,
: FloatTransform(config_path),
sample_size_{sample_size},
multiplier_{multiplier} {
set_requires_restart(true);
buf_.resize(sample_size_, 0);
initialized_ = false;
load_configuration();
Expand Down

0 comments on commit ffa69c3

Please sign in to comment.