fix: omv invalid temperature when not available (#2322)
This commit is contained in:
@@ -21,7 +21,7 @@ export interface HealthMonitoring {
|
||||
}[];
|
||||
smart: {
|
||||
deviceName: string;
|
||||
temperature: number;
|
||||
temperature: number | null;
|
||||
overallStatus: string;
|
||||
}[];
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ export const smartSchema = z.object({
|
||||
// Convert string to number if necessary
|
||||
const temp = typeof val === "string" ? parseFloat(val) : val;
|
||||
if (isNaN(temp)) {
|
||||
throw new Error("Invalid temperature value");
|
||||
return null;
|
||||
}
|
||||
return temp;
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user