@@ -40,6 +40,8 @@ pub enum Command { |
| 40 | 40 | #[serde(default)] |
| 41 | 41 | count: Option<usize>, |
| 42 | 42 | }, |
| 43 | + /// Get current temperature stats. |
| 44 | + GetTemperature, |
| 43 | 45 | /// Get running processes. |
| 44 | 46 | GetProcesses { |
| 45 | 47 | #[serde(default)] |
@@ -240,6 +242,30 @@ pub struct DiskStats { |
| 240 | 242 | pub timestamp: u64, |
| 241 | 243 | } |
| 242 | 244 | |
| 245 | +/// Individual temperature sensor reading. |
| 246 | +#[derive(Debug, Clone, Serialize, Deserialize)] |
| 247 | +pub struct TempSensor { |
| 248 | + /// Sensor label (e.g., "Core 0", "Package id 0", "GPU"). |
| 249 | + pub label: String, |
| 250 | + /// Hardware device name (e.g., "coretemp", "k10temp", "amdgpu"). |
| 251 | + pub device: String, |
| 252 | + /// Temperature in degrees Celsius. |
| 253 | + pub temp_celsius: f64, |
| 254 | + /// Critical temperature threshold (if available). |
| 255 | + pub critical: Option<f64>, |
| 256 | + /// High temperature threshold (if available). |
| 257 | + pub high: Option<f64>, |
| 258 | +} |
| 259 | + |
| 260 | +/// Temperature statistics from all sensors. |
| 261 | +#[derive(Debug, Clone, Serialize, Deserialize)] |
| 262 | +pub struct TempStats { |
| 263 | + /// All temperature sensor readings. |
| 264 | + pub sensors: Vec<TempSensor>, |
| 265 | + /// Timestamp (milliseconds since epoch). |
| 266 | + pub timestamp: u64, |
| 267 | +} |
| 268 | + |
| 243 | 269 | /// Events broadcast to subscribers. |
| 244 | 270 | #[derive(Debug, Clone, Serialize, Deserialize)] |
| 245 | 271 | #[serde(tag = "event", rename_all = "snake_case")] |
@@ -254,6 +280,8 @@ pub enum Event { |
| 254 | 280 | NetworkUpdate { interfaces: Vec<NetworkStats> }, |
| 255 | 281 | /// Disk stats updated. |
| 256 | 282 | DiskUpdate { disks: Vec<DiskStats> }, |
| 283 | + /// Temperature stats updated. |
| 284 | + TempUpdate(TempStats), |
| 257 | 285 | } |
| 258 | 286 | |
| 259 | 287 | /// Daemon status information. |