API
- class wins.core.Wins
Bases:
object控制 Raspberry Pi 的 GPIO 引脚和电机控制板的类。
_GPIO_BUTTON (int): Raspberry Pi 3 的按钮 GPIO 引脚。
_GPIO_LED (int): Raspberry Pi 3 的 LED GPIO 引脚(私有)。
_GPIO_MOTOR_BOARD_PI3 (int): Raspberry Pi 3 的电机控制板 GPIO 引脚(私有)。
_GPIO_MOTOR_BOARD_CM4 (int): Raspberry Pi CM4 的电机控制板 GPIO 引脚(私有)。
_GPIO_POWER (int): Raspberry Pi CM4 的电源 GPIO 引脚(私有)。
log (logging.Logger): 日志记录器实例。
pi_type (str): 当前 Raspberry Pi 的类型。
gpio_button (int): Raspberry Pi 3 的按钮 GPIO 引脚。
gpio_led (int): Raspberry Pi 3 的 LED GPIO 引脚。
gpio_motor (int): 当前 Raspberry Pi 的电机控制 GPIO 引脚。
gpio_power (int): Raspberry Pi CM4 的电源 GPIO 引脚。
- CM4 = 'CM4'
- PI3 = 'Pi3'
- create_motor_ctrl_board()
创建并返回适合的电机控制板实例。硬件通信协议的不同决定了返回实例的类型的不同。
- Returns:
适合的电机控制板实例。
- Return type:
- Raises:
UnsupportedHardware – 如果与两个波特率的电机控制板都无法通信。
- initialize_devices()
检测所有串口并初始化设备
- class wins.motorctrlboard.MotorCtrlBoard(port, baudrate)
Bases:
ABC- close()
关闸。
连接串口并发送关闸指令。
- Returns:
如果关闸成功则返回True,否则返回False。
- Return type:
bool
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- get_boomarm_status()
获取闸杆状态。
发送获取状态的指令并解析返回值,包括工作模式、闸杆状态和过行位置。
- Returns:
- 包含道闸状态信息的字典,如果获取失败,则返回 None。字典结构如下:
”operating_mode” (int): 工作模式(0=停闸,1=关闸,2=开闸,3=通过遥控关闸,4=通过遥控开闸,5=检修, 6=通过 KFB 开闸,7=通过 KFB,8=通过按键开闸关闸,9=通过按键关闸,10=触发雷达防砸开闸,11=道闸限时自动落杆, 13=雷达绿灯全灭时触发关闸)。
”barrier_status” (int): 闸杆状态(0=在中闸,1=关到位,2=开到位)。
”crossing_position” (int): 过行位置。
- Return type:
dict
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- get_version()
获取电机控制器版本号。
发送获取版本号的指令并解析返回值。
- Returns:
道闸版本号。如果获取失败,则返回 None。
- Return type:
int
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- open()
开闸。
连接串口并发送开闸指令。
- Returns:
如果开闸成功则返回True,否则返回False。
- Return type:
bool
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- class wins.motorctrlboard1.MotorCtrlBoard0(port)
Bases:
MotorCtrlBoard- get_boomarm_status()
获取闸杆状态。
发送获取状态的指令并解析返回值,包括工作模式、闸杆状态和过行位置。
- Returns:
- 包含道闸状态信息的字典,如果获取失败,则返回 None。字典结构如下:
”operating_mode” (int): 工作模式(0=停闸,1=关闸,2=开闸,3=通过遥控关闸,4=通过遥控开闸,5=检修, 6=通过 KFB 开闸,7=通过 KFB,8=通过按键开闸关闸,9=通过按键关闸,10=触发雷达防砸开闸,11=道闸限时自动落杆, 13=雷达绿灯全灭时触发关闸)。
”barrier_status” (int): 闸杆状态(0=在中闸,1=关到位,2=开到位)。
”crossing_position” (int): 过行位置。
- Return type:
dict
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- get_config()
读取电机控制器配置参数。
发送读取配置的指令并解析返回的16个字节的参数。
- Returns:
- 包含道闸配置参数的字典,如果获取失败,则返回 None。字典结构如下:
”open_speed” (int): 开闸速度调节数值(0-90)。
”close_speed” (int): 关闸速度调节数值(0-90)。
”position_adjust” (int): 到位调节(0-90)。
”reaction_time” (int): 防闸车反应时间调节(0-255)。
”motor_strength” (int): 电机力度调节(0-255)。
”horizontal_position” (int): 道闸杆水平位置调节(0-255)。
”test_mode” (int): 测试模式选择(0-1)。
”memory_function” (int): 开闸记忆功能设置(0-1)。
”vertical_position” (int): 道闸杆垂直位置调节(0-255)。
”deceleration_open” (int): 第一段开闸减速度行程(0-255)。
”deceleration_close” (int): 第一段关闸减速度行程(0-255)。
”barrier_strength” (int): 防闸车力度调节(0-255)。
”motor_direction” (int): 道闸电机正反转调节(0-3)。
”start_strength” (int): 道闸启动电机力度值(0-255)。
”remote_match” (int): 遥控接收到匹配值。
- Return type:
dict
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- get_version()
获取电机控制器版本号。
发送获取版本号的指令并解析返回值。
- Returns:
道闸版本号。固定为10。
- Return type:
int
- set_config(config_json)
设置电机控制器配置参数。
发送设置配置的指令,包含16个字节的数据,分别设置道闸的各项参数。
- Parameters:
config_json (str) –
包含道闸配置参数的 JSON 字符串。格式如下:
{ "open_speed": int, # 开闸速度,范围:0-90,参考值:90 "close_speed": int, # 关闸速度,范围:0-90,参考值:70 "position_adjust": int, # 到位调节,范围:0-90,参考值:15 "reaction_time": int, # 防闸车反应时间,范围:0-255,参考值:15 "motor_strength": int, # 电机力度,范围:0-255,参考值:40 "horizontal_position": int, # 道闸杆水平位置,范围:0-255,参考值:5 "test_mode": int, # 测试模式选择,0为手动,1为自动,范围:0-255 "memory_function": int, # 开闸记忆功能,0为关闭,1为开启 "vertical_position": int, # 道闸杆垂直位置,范围:0-255,参考值:5 "deceleration_open": int, # 第一段开闸减速度行程,范围:0-255,参考值:45 "deceleration_close": int, # 第一段关闸减速度行程,范围:0-255,参考值:30 "barrier_strength": int, # 防闸车力度,范围:0-255,参考值:20 "motor_direction": int, # 电机正反转调节,0/1/2/3,参考值:0 "start_strength": int, # 启动电机力度值,范围:0-255,参考值:30 "remote_match": int # 遥控接收到匹配值,范围:0-255 }
- Returns:
设置成功返回 True,失败返回 False。
- Return type:
bool
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- class wins.motorctrlboard1.MotorCtrlBoard1(port)
Bases:
MotorCtrlBoard- get_boomarm_status()
获取闸杆状态(MotorCtrlBoard1版本)。
发送获取状态的指令并解析返回值,包括工作模式、闸杆状态和过行位置。
- Returns:
- 包含道闸状态信息的字典,如果获取失败,则返回 None。字典结构如下:
”operating_mode” (int): 工作模式(0=停闸,1=关闸,2=开闸)。
”barrier_status” (int): 闸杆状态(0=在中闸,1=关到位,2=开到位)。
”crossing_position” (int): 过行位置。
- Return type:
dict
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- get_config()
读取电机控制器配置参数。
发送读取配置的指令并解析返回的16个字节的参数。
- Returns:
- 包含道闸配置参数的字典,如果获取失败,则返回 None。字典结构如下:
”open_speed” (int): 开闸速度调节数值(0-90)。
”close_speed” (int): 关闸速度调节数值(0-90)。
”position_adjust” (int): 到位调节(0-90)。
”reaction_time” (int): 防闸车反应时间调节(0-255)。
”motor_strength” (int): 电机力度调节(0-255)。
”horizontal_position” (int): 道闸杆水平位置调节(0-255)。
”test_mode” (int): 测试模式选择(0-1)。
”memory_function” (int): 开闸记忆功能设置(0-1)。
”vertical_position” (int): 道闸杆垂直位置调节(0-255)。
”deceleration_open” (int): 第一段开闸减速度行程(0-255)。
”deceleration_close” (int): 第一段关闸减速度行程(0-255)。
”barrier_strength” (int): 防闸车力度调节(0-255)。
”motor_direction” (int): 道闸电机正反转调节(0-3)。
”start_strength” (int): 道闸启动电机力度值(0-255)。
”remote_match” (int): 遥控接收到匹配值。
- Return type:
dict
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- set_config(config_json)
设置电机控制器配置参数。
发送设置配置的指令,包含16个字节的数据,分别设置道闸的各项参数。
- Parameters:
config_json (str) –
包含道闸配置参数的 JSON 字符串。格式如下:
{ "open_speed": int, # 开闸速度,范围:0-90,参考值:90 "close_speed": int, # 关闸速度,范围:0-90,参考值:70 "position_adjust": int, # 到位调节,范围:0-90,参考值:15 "reaction_time": int, # 防闸车反应时间,范围:0-255,参考值:15 "motor_strength": int, # 电机力度,范围:0-255,参考值:40 "horizontal_position": int, # 道闸杆水平位置,范围:0-255,参考值:5 "test_mode": int, # 测试模式选择,0为手动,1为自动,范围:0-255 "memory_function": int, # 开闸记忆功能,0为关闭,1为开启 "vertical_position": int, # 道闸杆垂直位置,范围:0-255,参考值:5 "deceleration_open": int, # 第一段开闸减速度行程,范围:0-255,参考值:45 "deceleration_close": int, # 第一段关闸减速度行程,范围:0-255,参考值:30 "barrier_strength": int, # 防闸车力度,范围:0-255,参考值:20 "motor_direction": int, # 电机正反转调节,0/1/2/3,参考值:0 "start_strength": int, # 启动电机力度值,范围:0-255,参考值:30 "remote_match": int # 遥控接收到匹配值,范围:0-255 }
- Returns:
设置成功返回 True,失败返回 False。
- Return type:
bool
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- class wins.motorctrlboard2.MotorCtrlBoard2(port)
Bases:
MotorCtrlBoard- get_boomarm_status()
获取闸杆状态(MotorCtrlBoard2版本)。
发送获取状态的指令并解析返回值,包括工作模式、闸杆状态和过行位置。
- Returns:
- 包含道闸状态信息的字典,如果获取失败,则返回 None。字典结构如下:
”operating_mode” (int): 工作模式(0=停闸,1=关闸,2=开闸,3=通过遥控关闸,4=通过遥控开闸,5=检修, 6=通过 KFB 开闸,7=通过 KFB,8=通过按键开闸关闸,9=通过按键关闸,10=触发雷达防砸开闸,11=道闸限时自动落杆, 13=雷达绿灯全灭时触发关闸)。
”barrier_status” (int): 闸杆状态(0=在中闸,1=关到位,2=开到位)。
”crossing_position” (int): 过行位置。
- Return type:
dict
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- get_config()
读取电机控制器参数。
发送读取配置的指令并解析返回的19个字节的参数。
- Returns:
- 包含道闸配置参数的字典,如果获取失败,则返回 None。字典结构如下:
”open_speed” (int): 开闸速度设置 (25-45, 参考值40)
”close_speed” (int): 关闸速度设置 (15-30, 参考值25)
”motor_strength” (int): 防砸力度设置 (20-40, 参考值35)
”peak_mode” (int): 高峰模式 (0-1, 参考值0)
”self_test_speed” (int): 道闸自检运行速度 (10-100, 参考值30)
”direction” (int): 开关闸方位 (0: 左开/关闸, 1: 右开/关闸, 参考值0)
”crash_delay” (int): 防砸延时 (0-255, 参考值0)
”auto_fall_time” (int): 起杆限时自动落杆时间设置 (0-255, 参考值60)
”alarm_setting” (int): 报警设置 (0: 关, 1: 开, 参考值1)
”max_travel_time” (int): 行程最大时间 (6-12, 参考值7)
”auto_switch” (int): 自动开关闸设置 (0: 关, 1: 开, 参考值0)
”horizontal_compensation” (int): 水平到位补偿值 (0-60, 参考值20)
”vertical_compensation” (int): 垂直到位补偿值 (0-70, 参考值20)
”zone1_travel” (int): 第一区行程 (100-300, 参考值220)
”zone3_travel” (int): 第三区行程 (100-300, 参考值220)
”crash_zone_travel” (int): 防砸区行程 (100-300, 参考值220)
- Return type:
dict
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- set_config(config_json)
设置电机控制器配置参数。
发送设置配置的指令,包含19个字节的数据,分别设置电机控制器的各项参数。
- Parameters:
config_json (str) –
包含道闸配置参数的 JSON 字符串。格式如下:
{ "open_speed": int, # 开闸速度 (25-45, 参考值40) "close_speed": int, # 关闸速度 (15-30, 参考值25) "motor_strength": int, # 防砸力度 (20-40, 参考值35) "peak_mode": int, # 高峰模式 (0-1, 参考值0) "self_test_speed": int, # 自检速度 (10-100, 参考值30) "direction": int, # 开关方位 (0: 左, 1: 右, 参考值0) "crash_delay": int, # 防砸延时 (0-255, 参考值0) "auto_fall_time": int, # 自动落杆时间 (0-255, 参考值60) "alarm_setting": int, # 报警设置 (0: 关, 1: 开, 参考值1) "max_travel_time": int, # 行程最大时间 (6-12, 参考值7) "auto_switch": int, # 自动开关闸 (0: 关, 1: 开, 参考值0) "horizontal_compensation": int, # 水平补偿 (0-60, 参考值20) "vertical_compensation": int, # 垂直补偿 (0-70, 参考值20) "zone1_travel": int, # 第一区行程 (100-300, 参考值220) "zone3_travel": int, # 第三区行程 (100-300, 参考值220) "crash_zone_travel": int # 防砸区行程 (100-300, 参考值220) }
- Returns:
设置成功返回 True,失败返回 False。
- Return type:
bool
- Raises:
serial.SerialException – 如果串口通信过程中发生错误。
- class wins.radar.Radar(port, baudrate=115200, timeout=1)
Bases:
ABC- get_all_parameter()
获取雷达所有参数
通过调用各自的获取方法,将这些参数组织成一个字典返回。
- Returns:
- 包含所有参数的字典。字典结构如下:
”version” (str): 设备的软件版本号,如果无法获取或解析版本信息,则返回 None。
”left_zone_width” (str): 左检测区域宽度值(单位:cm),如果读取成功则返回宽度值,否则返回 None。
”right_zone_width” (str): 右检测区域宽度值(单位:cm),如果读取成功则返回宽度值,否则返回 None。
”blank_zone_width” (str): 不检测区域宽度(单位:cm),如果读取失败则返回 None。
”delay_frame_count” (int): 延迟落杆的帧周期数,帧周期时间为50ms。若读取失败则返回 None。
”fixed_direction” (str): 雷达的固定方向,”1” 表示左固定,”2” 表示右固定。如果读取失败则返回 None。
”judge_tar_active” (int): 人车区分标志位,0表示关闭,1表示打开。
”blank_active_flag” (int): 不检测区域为保护区域标志位,0表示不是保护区,1表示是保护区。
”follow_active_flag” (int): 防跟车标志位,0表示关闭,1表示打开。
”pass_diretion_control_state” (int): 方向控制标志位,0表示禁止通行,1表示左到右通行,2表示右到左通行,3表示双向通行。
”car_pass_keep_state_period” (int): 人跟车防砸保护时长,返回值表示周期数,每个周期为50ms。例如,100表示5秒。
”protcol_output” (int): 协议输出控制标志位,0表示关闭,1表示打开。
”min_y_distance” (str): 临近不检测距离(yMin 值),如果解析成功则返回值,否则返回 None。
”pole_length” (str): 临近不检测距离(yMin 值),如果解析成功则返回值,否则返回 None。
”pole_to_radar_distance” (str): 杆与雷达的距离(单位:cm),如果解析成功则返回距离值,否则返回 None。
- Return type:
dict
- get_blank_zone_width()
读取不检测区域宽度。
通过发送指令获取不检测区域的宽度,并解析设备响应以提取宽度值。
- Returns:
不检测区域宽度(单位:cm),如果读取失败则返回 None。
- Return type:
str
- get_delay_frame_count()
读取雷达的延迟落杆时间。
通过发送特定指令获取延迟落杆时间,即返回的帧周期数。帧周期时间为50ms。
- Returns:
延迟的帧周期数,若读取失败则返回 None。
- Return type:
int
- get_fixed_direction()
读取雷达的左右固定设置。
通过发送指令读取设备的左右固定配置,以确定雷达的固定方向。
- Returns:
雷达的固定方向,”1” 表示左固定,”2” 表示右固定。如果读取失败则返回 None。
- Return type:
str
- get_generic_flag(flag_type)
读取通用配置标志位信息。
根据不同的标志位类型,发送相应的指令读取标志位信息。
- Parameters:
flag_type (int) –
标志位类型,值可以是以下之一:
1:读取人车区分标志位
2:读取不检测区域为保护区域标志位
3:读取防跟车标志位
4:读取方向控制标志位
5:读取人跟车防砸保护时长
6:读取协议输出控制标志位
- Returns:
- 返回对应的标志位值,如果成功则返回标志位值,否则返回 None,具体值如下:
如果flag_type为1,返回人车区分标志位,0表示关闭,1表示打开。
如果flag_type为2,返回不检测区域为保护区域标志位,0表示不是保护区,1表示是保护区。
如果flag_type为3,返回防跟车标志位,0表示关闭,1表示打开。
如果flag_type为4,返回方向控制标志位,0表示禁止通行,1表示左到右通行,2表示右到左通行,3表示双向通行。
如果flag_type为5,返回人跟车防砸保护时长,返回值表示周期数,每个周期为50ms。例如,100表示5秒。
如果flag_type为6,返回协议输出控制标志位,0表示关闭,1表示打开。
- Return type:
int
- get_min_y_distance()
获取临近不检测距离信息(yMin)。
通过发送特定指令给串口设备以获取临近不检测距离信息。解析设备响应以提取 yMin 值。
- Returns:
yMin 值,如果解析成功则返回值,否则返回 None。
- Return type:
str
- get_pole_length()
获取杆长信息。
通过发送特定指令给串口设备以获取杆长信息。解析设备响应以提取杆长。
- Returns:
杆长信息,如果解析成功则返回杆长,否则返回 None。
- Return type:
str
- get_pole_to_radar_distance()
读取杆与雷达的距离。
通过发送指令给串口设备以获取杆与雷达之间的距离。
- Returns:
杆与雷达的距离(单位:cm),如果解析成功则返回距离值,否则返回 None。
- Return type:
str
- get_side_zone_width(side)
读取左右检测区域宽度。
通过发送指令读取指定侧的检测区域宽度。
- Parameters:
side (int) – 选择读取左或右检测区域宽度,1 表示左侧,2 表示右侧。
- Returns:
检测区域宽度值(单位:cm),如果读取成功则返回宽度值,否则返回 None。
- Return type:
str
- get_version()
获取设备软件版本信息。
本函数通过发送预定义的命令来请求设备的软件版本信息,并解析响应以提取版本号。 使用串行通信进行数据传输,并通过日志记录响应和潜在的错误信息。
- Returns:
设备的软件版本号,如果无法获取或解析版本信息,则返回 None。
- Return type:
str
- reboot_radar()
执行雷达复位。
通过发送复位命令来重启雷达。
- Returns:
如果复位成功,返回True;否则返回False。
- Return type:
bool
- set_blank_active(active_flag)
中间不检测区域是否使能为保护区域。
根据传入的active_flag值,设置中间不检测区域是否作为保护区域。
- Parameters:
active_flag (int) – 使能标志位: 0:不使能 1:使能
- Returns:
如果设置成功,返回True;否则返回False。
- Return type:
bool
- Raises:
ValueError – 如果传入的active_flag值无效,抛出异常。
- set_blank_zone_width(value)
设置不检测区域宽度。
通过发送指令设置不检测区域的宽度。
- Parameters:
value (int) – 要设置的不检测区域宽度值,单位为 cm。
- Returns:
设置成功返回 True,失败返回 False。
- Return type:
bool
- set_car_pass_keep_time(keep_period)
设置人跟车防砸保护时长。
根据传入的keep_period值,设置防砸保护的时长。该时长是以50ms为一个周期的单位,设置100表示防砸保护时长为5秒。
- Parameters:
keep_period (int) – 保护时长,单位为周期,1个周期等于50ms。
- Returns:
如果设置成功,返回True;否则返回False。
- Return type:
bool
- Raises:
ValueError – 如果传入的keep_period值无效,抛出异常。
- set_delay_frame_count(value)
设置雷达延迟落杆时间。
通过发送特定指令到串口设备以设置雷达的延迟落杆时间(以帧周期为单位,帧周期时间为50ms)。
- 参数:
value (int): 设置的延迟帧周期数,代表延迟的帧数(每帧周期为50ms)。
- Returns:
如果设置成功则返回 True,否则返回 False。
- Return type:
bool
- set_fixed_direction(value)
设置雷达左右固定设置。
通过发送特定指令到串口设备以设置雷达的左右固定方向。
- 参数:
value (int): 设置的方向值。1 表示左固定,2 表示右固定。
- Returns:
如果设置成功则返回 True,否则返回 False。
- Return type:
bool
- set_judge_tar_active(active_flag)
是否使能人车区分功能。
根据传入的active_flag值,设置是否使能人车区分功能。使能后,人过亮黄灯,车过亮绿灯。
- Parameters:
active_flag (int) – 使能标志位: 0:不使能 1:使能
- Returns:
如果设置成功,返回True;否则返回False。
- Return type:
bool
- Raises:
ValueError – 如果传入的active_flag值无效,抛出异常。
- set_min_y_distance(y_min_value)
设置临近不检测距离 yMin 值。
通过发送特定指令给串口设备以设置 yMin 值,并解析设备响应以确认设置结果。
- Parameters:
y_min_value (int) – 要设置的 yMin 值(单位:cm)。
- Returns:
设置成功返回 True,否则返回 False。
- Return type:
bool
- set_pass_direction(direction)
控制允许进车方向。
根据传入的direction值,控制闸机允许的进车方向。
- Parameters:
direction (int) – 控制进车方向标志位: 0:双向禁止通车 1:只允许由左到右通车 2:只允许由右到左通车 3:双向允许通车
- Returns:
如果设置成功,返回True;否则返回False。
- Return type:
bool
- Raises:
ValueError – 如果传入的direction值无效,抛出异常。
- set_pole_length(length)
设置杆长
该方法通过发送命令来设置雷达的杆长。它编码命令并将其发送给雷达设备, 然后读取设备的响应以确定命令是否成功执行。
- Parameters:
length (int) – 要设置的杆长值。
- Returns:
如果命令成功执行,返回True;如果执行失败,返回False。
- Return type:
bool
- set_pole_to_radar_distance(value)
设置杆与雷达的距离。
通过发送特定指令来设置杆与雷达之间的距离。
- Parameters:
value (int) – 设置的距离值(单位:cm)。
- Returns:
如果设置成功返回 True,否则返回 False。
- Return type:
bool
- set_side_zone_width(side, value)
设置左右检测区域宽度。
通过发送指令设置指定侧的检测区域宽度。
- Parameters:
side (int) – 选择设置左或右检测区域宽度,1 表示左侧,2 表示右侧。
value (int) – 要设置的检测区域宽度值(单位:cm)。
- Returns:
成功返回 True,失败返回 False。
- Return type:
bool
- class wins.power.PowerBoard(port, baudrate=115200, timeout=1)
Bases:
ABC- get_low_voltage_protection()
获取电源板低压保护值。
- Returns:
电源板低压保护值,则返回 None。
- Return type:
float
- get_low_voltage_recovery()
获取电源板低压恢复值。
- Returns:
电源板低压恢复值,则返回 None。
- Return type:
float
- get_version()
获取设备软件版本信息。
- Returns:
设备的软件版本号,如果无法获取或解析版本信息,则返回 None。
- Return type:
str
- get_voltage_and_temperature()
获取电源板电压和温度。
- Returns:
- 包含电源板电压和温度的字典,如果获取失败,则返回 None。字典结构如下:
”voltage” (float): 当前电压
”temperature” (float): 当前温度
- Return type:
dict