1
0
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:
Tw93
2026-01-08 11:27:47 +08:00
parent 7d6d5eb8b0
commit 64a580b3a7
4 changed files with 83 additions and 24 deletions

View File

@@ -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
}
}
}