Skip to content

Commit 78ef52c

Browse files
committed
hw-mgmgt: thermal: TC: Fix default input val smoothing level
Continuation for bug fix: 4452512 Signed-off-by: Oleksandr Shamray <[email protected]>
1 parent 4e24be4 commit 78ef52c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

usr/usr/bin/hw_management_thermal_control_2_5.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,6 @@ def __init__(self, cmd_arg, sys_config, name, tc_logger):
12731273
self.file_input = "{}{}".format(self.base_file_name, self.sensors_config.get("input_suffix", ""))
12741274
self.enable = bool(self.sensors_config.get("enable", 1))
12751275
self.input_smooth_level = self.sensors_config.get("input_smooth_level", CONST.MIN_SMOOTH_LEVEL)
1276-
self.input_smooth_level = min(self.input_smooth_level, CONST.MIN_SMOOTH_LEVEL)
12771276

12781277
self.poll_time = int(self.sensors_config.get("poll_time", CONST.SENSOR_POLL_TIME_DEF))
12791278
self.update_timestump(1000)
@@ -1461,7 +1460,8 @@ def _update_value_formula(self, value, formula_type=CONST.VAL_AVG_EMA):
14611460
self.value_items_weght[0] = 0.5+(1/input_smooth_level)
14621461
for idx in range(1, input_smooth_level-1):
14631462
self.value_items_weght[idx] = (1 - sum(self.value_items_weght[0:idx])) / 2
1464-
self.value_items_weght[self.input_smooth_level] = self.value_items_weght[self.input_smooth_level-1]
1463+
if input_smooth_level > 2:
1464+
self.value_items_weght[self.input_smooth_level] = self.value_items_weght[self.input_smooth_level-1]
14651465

14661466
self.value_items_lst = [value] + self.value_items_lst[:-1]
14671467
result = [a * b for a, b in zip(self.value_items_lst, self.value_items_weght)]

0 commit comments

Comments
 (0)