forked from alibaba-archive/alibabacloud-tool-bmc-hal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhal_dcdc.py
55 lines (43 loc) · 1.29 KB
/
hal_dcdc.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
###############################################################################
#
# Hardware Abstraction Layer APIs -- Temperature APIs.
#
# Copyright (C) Alibaba, INC.
#
###############################################################################
HAL_DCDC_SENSOR = "DCDC_SENSORS"
"""
class for HAL DC/DC APIs.
"""
class HalDcdc(object):
def __init__(self, sensor_obj):
"""
@param sensor_obj Instance of HalSensor from hal_sensor module
"""
self.sensors = sensor_obj
def get_dcdc_sensors(self):
sensor_dict = None
dcdc_sensors = self.sensors.config[HAL_DCDC_SENSOR]
if dcdc_sensors is not None:
sensor_dict = {}
for name in dcdc_sensors:
sensor_dict[name] = dcdc_sensors[name]
return sensor_dict
def get_dcdc_sensor_value(self, name):
"""
Get DCDC sonsor.
@return voltage_dict for DCDC or None for failure
"""
pass
def get_dcdc_sensor_descr(self, name):
"""
Get DCDC sensor's description.
@return description string or None for failure
"""
pass
def get_dcdc_all_info(self):
"""
Get all DCDC sensor info
@return dict for all DCDC info or None for failure
"""
pass