Fixed issue when faulty FAN returns invalid values and clipped RPM to percent converter to zero for small values.

This commit is contained in:
Domen Tabernik 2019-12-10 17:07:38 +01:00
parent be187a1130
commit 1857fd168e
1 changed files with 6 additions and 3 deletions

View File

@ -61,7 +61,7 @@ FAN_ZONES_MEMBERS= {
# SYS1 and SYS2 fans use the following linear equations to # SYS1 and SYS2 fans use the following linear equations to
# convert from RPM to % value # convert from RPM to % value
def SUPERMICRO_4029GP_TRT2_RPM_to_percent(rpm): def SUPERMICRO_4029GP_TRT2_RPM_to_percent(rpm):
return rpm * 0.0098 - 11.5479 return max(rpm * 0.0098 - 11.5479,0)
def set_fan_with_full_preset(config, speed, zone): def set_fan_with_full_preset(config, speed, zone):
""" """
@ -219,8 +219,11 @@ def ipmi_fan_status(hostname = 'localhost', username=None, password=None, use_en
if len(fan_str.strip()) > 0: if len(fan_str.strip()) > 0:
fan_stat = fan_str.split("|") fan_stat = fan_str.split("|")
fan_name = fan_stat[0].strip() fan_name = fan_stat[0].strip()
fan_rpm = float(fan_stat[1].strip()) try:
fan_status_return[fan_name] = fan_rpm fan_rpm = float(fan_stat[1].strip())
fan_status_return[fan_name] = fan_rpm
except ValueError:
pass
return fan_status_return return fan_status_return
def get_preset(config): def get_preset(config):