Lines Matching defs:threshold
114 "Malformed threshold on configuration interface: '{INTERFACE}'",
139 const thresholds::Threshold& threshold,
148 [&, path, threshold, thresholdInterface,
153 return; // threshold not supported
161 lg2::error("No label in threshold configuration");
178 lg2::error("Malformed threshold in configuration");
186 if ((findThresholdLevel(severity) != threshold.level) ||
187 (findThresholdDirection(dir) != threshold.direction))
192 std::variant<double> value(threshold.value);
198 "Error setting threshold: '{ERROR_MESSAGE}'",
212 for (const auto& threshold : sensor->thresholds)
215 sensor->getThresholdInterface(threshold.level);
223 Sensor::propertyLevel(threshold.level, threshold.direction);
228 interface->set_property(property, threshold.value);
245 threshold(whichThreshold), asserted(status), assertValue(value)
248 Threshold threshold;
261 for (auto& threshold : sensor->thresholds)
263 // Use "Schmitt trigger" logic to avoid threshold trigger spam,
264 // if value is noisy while hovering very close to a threshold.
265 // When a threshold is crossed, indicate true immediately,
268 if (threshold.direction == thresholds::Direction::HIGH)
270 if (value >= threshold.value)
272 thresholdChanges.emplace_back(threshold, true, value);
276 "Sensor name: {NAME}, high threshold: {THRESHOLD}, "
278 "NAME", sensor->name, "THRESHOLD", threshold.value,
282 else if (value < (threshold.value - threshold.hysteresis))
284 thresholdChanges.emplace_back(threshold, false, value);
292 else if (threshold.direction == thresholds::Direction::LOW)
294 if (value <= threshold.value)
296 thresholdChanges.emplace_back(threshold, true, value);
300 "Sensor name: {NAME}, low threshold: {THRESHOLD}, "
302 "NAME", sensor->name, "THRESHOLD", threshold.value,
306 else if (value > (threshold.value + threshold.hysteresis))
308 thresholdChanges.emplace_back(threshold, false, value);
318 lg2::error("Error determining threshold direction");
339 const Threshold& threshold, bool assert,
360 pair->first.level = threshold.level;
361 pair->first.direction = threshold.direction;
364 pair->second.async_wait([weakSensor, pair, threshold, assert,
386 assertThresholds(sensorPtr.get(), assertValue, threshold.level,
387 threshold.direction, assert);
398 assertThresholds(sensor, change.assertValue, change.threshold.level,
399 change.threshold.direction, change.asserted);
400 if (change.threshold.level == thresholds::Level::CRITICAL &&
434 if (change.threshold.direction == thresholds::Direction::LOW)
437 change.threshold, !change.asserted))
439 thresholdTimer.startTimer(weakSensor, change.threshold,
444 assertThresholds(sensor, change.assertValue, change.threshold.level,
445 change.threshold.direction, change.asserted);