Update main.py

This commit is contained in:
星光-k
2025-01-08 01:43:38 +08:00
committed by GitHub
parent ac58f0ac8f
commit 0767f79a19

View File

@@ -77,13 +77,13 @@ def power_battery():
# 检查电量信息
if not battery_percentage:
return "电量信息无效"
return "无效"
# 返回电量百分比
return f"{int(battery_percentage)}%"
except Exception as e:
# 返回错误信息
return "获取电量失败"
return "失败"
# 打印电量信息
print(power_battery())