Added frost risk
This commit is contained in:
@@ -18,3 +18,11 @@ export async function fetchIcon(icon) {
|
||||
await downloadIcon(icon, iconPath);
|
||||
return iconPath;
|
||||
}
|
||||
|
||||
export function frostRisk(tempC, dewPointC, humidity) {
|
||||
if (tempC > 4) return 'None'
|
||||
if (tempC <= 0 && dewPointC <= 0) return 'High'
|
||||
if (tempC <= 2 && humidity > 85) return 'Moderate'
|
||||
if (tempC <= 4) return 'Low'
|
||||
return 'None'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user