blob: 70115081cd2ce39978508716b024b0815fbb5305 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
From 727b21cec06a5f5ae921dfe6500b94761e00eeb5 Mon Sep 17 00:00:00 2001
From: "Evgeny Alekseev (IBS Group)" <ealekseev@ibs.sila.ru>
Date: Thu, 25 Aug 2022 15:18:30 +0300
Subject: [PATCH] Add All Thresholds to CPUSensors
---
src/Thresholds.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp
index 5fa82aa..6c707b9 100644
--- a/src/Thresholds.cpp
+++ b/src/Thresholds.cpp
@@ -522,6 +522,20 @@ bool parseThresholdsFromAttr(
}
}
}
+ for( const auto& th2add : map.at("input") )
+ {
+ bool already_has_th=false;
+ for( const auto &th : thresholdVector)
+ {
+ if((th.level == std::get<1>(th2add)) && (th.direction == std::get<2>(th2add)))
+ already_has_th = true;
+ }
+ if(!already_has_th)
+ {
+ thresholdVector.emplace_back(std::get<1>(th2add), std::get<2>(th2add), std::get<2>(th2add)==Direction::HIGH?1000000:-1.0);
+ }
+ }
+
return true;
}
|