Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[device/alibaba] - Update sensor monitoring format. #53

Merged
merged 3 commits into from Feb 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def get_cpld_version(self):
int(CPLD_3[2], 16), int(CPLD_3[3], 16))
CPLD_4 = 'None' if CPLD_4 is 'None' else "{}.{}".format(
int(CPLD_4[2], 16), int(CPLD_4[3], 16))
FAN_CPLD = 'None' if CPLD_4 is None else "{:.1f}".format(
float(fan_cpld))
FAN_CPLD = 'None' if CPLD_4 is None else "{}.{}".format(
int(fan_cpld[0], 16), int(fan_cpld[1], 16))

cpld_version_dict = {}
cpld_version_dict.update({'CPLD_B': CPLD_B})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ def input_name_selector(self, sensor_name, input_name):
"tmp75-i2c-39-48": "BTF_INLET_RIGHT",
"tmp75-i2c-39-49": "BTF_INLET_LEFT"
}.get(sensor_name, input_name)
if self.get_sys_airflow() == "FTOB" and sensor_name == "tmp75-i2c-7-4d":
input_name = "INLET_TEMP"

if self.get_sys_airflow() == "BTOF" and sensor_name == "tmp75-i2c-39-48":
input_name = "INLET_TEMP"

self.sensor_name = "TEMPERATURE"

elif 'fancpld' in sensor_name:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def get_cpld_version(self):
int(CPLD_3[2], 16), int(CPLD_3[3], 16))
CPLD_4 = 'None' if CPLD_4 is 'None' else "{}.{}".format(
int(CPLD_4[2], 16), int(CPLD_4[3], 16))
FAN_CPLD = 'None' if CPLD_4 is None else "{:.1f}".format(
float(fan_cpld))
FAN_CPLD = 'None' if CPLD_4 is None else "{}.{}".format(
int(fan_cpld[0], 16), int(fan_cpld[1], 16))

cpld_version_dict = {}
cpld_version_dict.update({'CPLD_B': CPLD_B})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ def input_name_selector(self, sensor_name, input_name):
"tmp75-i2c-39-48": "BTF_INLET_RIGHT",
"tmp75-i2c-39-49": "BTF_INLET_LEFT"
}.get(sensor_name, input_name)
if self.get_sys_airflow() == "FTOB" and sensor_name == "tmp75-i2c-7-4d":
input_name = "INLET_TEMP"

if self.get_sys_airflow() == "BTOF" and sensor_name == "tmp75-i2c-39-48":
input_name = "INLET_TEMP"

self.sensor_name = "TEMPERATURE"

elif 'fancpld' in sensor_name:
Expand Down Expand Up @@ -326,6 +332,7 @@ def get_all(self):

# Set sensor data.
sensor_dict = dict()

for k, v in sensor_info.items():
sensor_i_dict = dict()
sensor_data_str = v.split()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def get_cpld_version(self):
int(CPLD_3[2], 16), int(CPLD_3[3], 16))
CPLD_4 = 'None' if CPLD_4 is 'None' else "{}.{}".format(
int(CPLD_4[2], 16), int(CPLD_4[3], 16))
FAN_CPLD = 'None' if CPLD_4 is None else "{:.1f}".format(
float(fan_cpld))
FAN_CPLD = 'None' if CPLD_4 is None else "{}.{}".format(
int(fan_cpld[0], 16), int(fan_cpld[1], 16))

cpld_version_dict = {}
cpld_version_dict.update({'CPLD_B': CPLD_B})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def input_name_selector(self, sensor_name, input_name):
"tmp75-i2c-7-4e": "BASEBOARD_INLET_CENTER",
"tmp75-i2c-7-4d": "SWITCH_OUTLET",
"tmp75-i2c-31-48": "PSU_INLET_LEFT",
"tmp75-i2c-31-49": "PSU_INLET_RIGHT",
"tmp75-i2c-31-49": "INLET_TEMP",
"tmp75-i2c-39-48": "FANBOARD_LEFT",
"tmp75-i2c-39-49": "FANBOARD_RIGHT",
"tmp75-i2c-42-48": "LINECARD_TOP_RIGHT",
Expand Down