refine power module
This commit is contained in:
@@ -1984,7 +1984,10 @@ class NetworkManager:
|
||||
elif inner_cmd == 4: # 上报电量
|
||||
voltage = get_bus_voltage()
|
||||
battery_percent = voltage_to_percent(voltage)
|
||||
battery_data = {"battery": battery_percent, "voltage": round(voltage, 3)}
|
||||
battery_data = {
|
||||
"battery": battery_percent,
|
||||
"voltage": round(float(voltage), 3),
|
||||
}
|
||||
self.safe_enqueue(battery_data, 2)
|
||||
self.logger.info(f"电量上报: {battery_percent}%")
|
||||
elif inner_cmd == 5: # OTA 升级
|
||||
|
||||
Reference in New Issue
Block a user