using FanControl.Plugins; namespace FanControl.ChromeboxEC; /// 温度:ectool temps <sensorid> public sealed class ChromeboxECTempSensor : IPluginSensor { private readonly string _ectoolPath; private readonly string[] _tempArgs; public ChromeboxECTempSensor(string ectoolPath, string[] tempArgs) { _ectoolPath = ectoolPath; _tempArgs = tempArgs; } public string Id => "ChromeboxEC_Temp"; public string Name => "Chromebox EC Temperature"; public string Origin => "ectool temps"; public float? Value { get; private set; } public void Update() { var (ok, stdout, _) = EctoolRunner.Run(_ectoolPath, _tempArgs); Value = ok && EctoolRunner.TryParseTemp(stdout) is { } temp ? temp : null; } }