Skip to content

Commit 17292e4

Browse files
authored
Changes in fan and psu base classes (1.0 platform API) related to pddf_2.0 (#92)
Small changes in 1.0 platform plugins psu_base.py and fan_base.py. Changes are related to PDDF 2.0 changes. psu_base.py: - psu_fan speed API name change - Changing the voltage, current and power units to fan_base.py: - Individual fans are counted instead of fantrays units - get_speed_rear() is not required
1 parent 42781ff commit 17292e4

File tree

2 files changed

+8
-18
lines changed

2 files changed

+8
-18
lines changed

sonic_fan/fan_base.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,14 @@ def get_direction(self, index):
6161

6262
def get_speed(self, index):
6363
"""
64-
Retrieves the speed of a Front FAN in the tray in revolutions per minute defined
64+
Retrieves the speed of a FAN in the tray in revolutions per minute defined
6565
by 1-based index <index>
6666
6767
:param index: An integer, 1-based index of the FAN of which to query speed
6868
:return: integer, denoting front FAN speed
6969
"""
7070
return 0
7171

72-
def get_speed_rear(self, index):
73-
"""
74-
Retrieves the speed of a rear FAN in the tray (applicable only for 2-fan tray)
75-
in revolutions per minute defined by 1-based index <index>
76-
77-
:param index: An integer, 1-based index of the FAN of which to query speed
78-
:return: integer, denoting rear FAN speed
79-
"""
80-
return 0
81-
8272
def set_speed(self, val):
8373
"""
8474
Sets the speed of all the FANs to a value denoted by the duty-cycle percentage val

sonic_psu/psu_base.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -88,29 +88,29 @@ def get_output_voltage(self, idx):
8888
Retrieves the ouput volatage in milli volts of a power supply unit (PSU) defined
8989
by 1-based index <idx>
9090
:param idx: An integer, 1-based index of the PSU of which to query o/p volatge
91-
:return: An integer, value of o/p voltage in mV if PSU is good, else zero
91+
:return: A float, value of o/p voltage in Volts if PSU is good, else zero
9292
"""
93-
return 0
93+
return 0.0
9494

9595
def get_output_current(self, idx):
9696
"""
9797
Retrieves the output current in milli amperes of a power supply unit (PSU) defined
9898
by 1-based index <idx>
9999
:param idx: An integer, 1-based index of the PSU of which to query o/p current
100-
:return: An integer, value of o/p current in mA if PSU is good, else zero
100+
:return: A float, value of o/p current in Amps if PSU is good, else zero
101101
"""
102-
return 0
102+
return 0.0
103103

104104
def get_output_power(self, idx):
105105
"""
106106
Retrieves the output power in micro watts of a power supply unit (PSU) defined
107107
by 1-based index <idx>
108108
:param idx: An integer, 1-based index of the PSU of which to query o/p power
109-
:return: An integer, value of o/p power in micro Watts if PSU is good, else zero
109+
:return: A float, value of o/p power in Watts if PSU is good, else zero
110110
"""
111-
return 0
111+
return 0.0
112112

113-
def get_fan_speed(self, idx, fan_idx):
113+
def get_fan_rpm(self, idx, fan_idx):
114114
"""
115115
Retrieves the speed of fan, in rpm, denoted by 1-based <fan_idx> of a power
116116
supply unit (PSU) defined by 1-based index <idx>

0 commit comments

Comments
 (0)