mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 23:11:11 +00:00
feat: cat hide toggle and critical fixes (#272)
- Add 'k' key to hide/show cat in mo status - Hand-crafted mirror frames for better left-walking animation - Fix extra blank lines bug (strings.Lines → strings.Split) - Fix battery power overflow (ParseInt for negative values) - Optimize README Tips section (8 → 5 items)
This commit is contained in:
@@ -238,8 +238,9 @@ func collectThermal() ThermalStatus {
|
||||
valStr, _, _ = strings.Cut(valStr, ",")
|
||||
valStr, _, _ = strings.Cut(valStr, "}")
|
||||
valStr = strings.TrimSpace(valStr)
|
||||
if powerMW, err := strconv.ParseFloat(valStr, 64); err == nil {
|
||||
thermal.BatteryPower = powerMW / 1000.0
|
||||
// Parse as int64 first to handle negative values (charging)
|
||||
if powerMW, err := strconv.ParseInt(valStr, 10, 64); err == nil {
|
||||
thermal.BatteryPower = float64(powerMW) / 1000.0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user