From ffa69c3a75dfba6643af4d3c5d8bb2a09f7d3d72 Mon Sep 17 00:00:00 2001 From: Matti Airas Date: Mon, 12 Aug 2024 21:21:28 +0300 Subject: [PATCH] Flag some sensors and transforms to require restart --- src/sensesp/sensors/digital_input.h | 1 + src/sensesp/transforms/median.cpp | 1 + src/sensesp/transforms/moving_average.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/sensesp/sensors/digital_input.h b/src/sensesp/sensors/digital_input.h index 7db74c624..97e58a9e1 100644 --- a/src/sensesp/sensors/digital_input.h +++ b/src/sensesp/sensors/digital_input.h @@ -53,6 +53,7 @@ class DigitalInputState : public DigitalInput, public Sensor { Sensor(config_path), read_delay_{read_delay}, triggered_{false} { + set_requires_restart(true); load_configuration(); ReactESP::app->onRepeat(read_delay_, [this]() { emit(digitalRead(pin_)); }); diff --git a/src/sensesp/transforms/median.cpp b/src/sensesp/transforms/median.cpp index 5bda3202e..dc3f80d26 100644 --- a/src/sensesp/transforms/median.cpp +++ b/src/sensesp/transforms/median.cpp @@ -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(); diff --git a/src/sensesp/transforms/moving_average.cpp b/src/sensesp/transforms/moving_average.cpp index 8b26ccc56..8db4fb621 100644 --- a/src/sensesp/transforms/moving_average.cpp +++ b/src/sensesp/transforms/moving_average.cpp @@ -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();