summaryrefslogtreecommitdiff
path: root/meta-ibs/meta-common/recipes-phosphor/sensors/dbus-sensors/0003-Add-temp-high-thresholds.patch
blob: 20033f8f4524a2a6af7c9f537d1d96a34d976d5a (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
From f73c22d90eee5dd18f9f6b84aa19064437f19be3 Mon Sep 17 00:00:00 2001
From: "Evgeny Alekseev (IBS Group)" <ealekseev@ibs.sila.ru>
Date: Wed, 12 Oct 2022 17:21:52 +0300
Subject: [PATCH] Add temp high thresholds

---
 src/Thresholds.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/Thresholds.cpp b/src/Thresholds.cpp
index 610e68e..9bc8098 100644
--- a/src/Thresholds.cpp
+++ b/src/Thresholds.cpp
@@ -516,6 +516,16 @@ bool parseThresholdsFromAttr(
                     }
                     thresholdVector.emplace_back(level, direction, *val);
                 }
+                else
+                {
+                    if( inputPath.find("temp") != std::string::npos )
+                    {
+                        if(( level == Level::WARNING) && (direction == Direction::HIGH))
+                            thresholdVector.emplace_back(level, direction, 65.0);
+                        if(( level == Level::CRITICAL) && (direction == Direction::HIGH))
+                            thresholdVector.emplace_back(level, direction, 75.0);
+                    }
+                }
             }
         }
     }