Skip to content

Commit b8f3e15

Browse files
committed
fix(aifalse): align lhmSensor fields on non-Windows for cross-compiling
1 parent f2ccacf commit b8f3e15

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

plugin/aifalse/hardware_other.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,14 @@ func init() {
5454
// queryHWiNFO 非 Windows 平台无 HWiNFO。
5555
func queryHWiNFO() (temps, fans, powers []*status) { return nil, nil, nil }
5656

57-
// lhmSensor 在非 Windows 平台不需要(LibreHardwareMonitor 仅支持 Windows)。
58-
type lhmSensor struct{}
57+
// lhmSensor 非 Windows 平台不采集(LibreHardwareMonitor 仅支持 Windows),
58+
// 但字段需与 hardware_windows.go 保持一致,供跨平台代码(tempstate)编译通过。
59+
type lhmSensor struct {
60+
Name string
61+
SensorType string // Temperature / Fan / Power / Load / Clock / Voltage / Control
62+
Parent string
63+
Value float64
64+
}
5965

6066
// queryLibreHardwareMonitor 非 Windows 平台永远返回 nil。
6167
func queryLibreHardwareMonitor() []lhmSensor { return nil }

0 commit comments

Comments
 (0)