8 buf_.reserve(sample_size_);
13 buf_.push_back(input);
14 if (buf_.size() >= sample_size_) {
16 sort(buf_.begin(), buf_.end());
17 const unsigned int mid = sample_size_ / 2;
25 root[
"sample_size"] = sample_size_;
30 String
const expected[] = {
"sample_size"};
31 for (
auto str : expected) {
32 if (!config[str].is<JsonVariant>()) {
36 unsigned int const sample_size_new = config[
"sample_size"];
37 if (sample_size_ != sample_size_new) {
38 sample_size_ = sample_size_new;
39 buf_.reserve(sample_size_);
46 return R
"({"type":"object","properties":{"sample_size":{"title":"Sample size","description":"Number of samples to take before outputing a value","type":"integer"}}})";
virtual bool load() override
Load and populate the object from a persistent storage.
const String ConfigSchema(const SmartSwitchController &obj)