Added frost risk
This commit is contained in:
@@ -4,6 +4,7 @@ import { fileURLToPath } from 'url'
|
||||
import { tzOffsetMinutes } from './config.mjs'
|
||||
import { getWeatherCondition } from './forecast.mjs'
|
||||
import { getCelestialForecast } from './celestial.mjs'
|
||||
import {frostRisk} from './openweather.mjs';
|
||||
|
||||
const DIR = dirname(fileURLToPath(import.meta.url))
|
||||
const ICON_DIR = resolve(DIR, 'public', 'icons')
|
||||
@@ -138,6 +139,7 @@ export async function dailyWeather(lat, lon, start, end) {
|
||||
precipitation: precip,
|
||||
precipitation_chance: precipChance,
|
||||
accumulation: precip,
|
||||
frost_risk: frostRisk(temp, dewPoint(temp, humidity), humidity),
|
||||
uv_index: data.daily.uv_index_max[i] ?? 0,
|
||||
uv_index_max: data.daily.uv_index_max[i] ?? 0,
|
||||
uv_dose: 0,
|
||||
@@ -241,6 +243,7 @@ export async function hourlyWeather(lat, lon, start, end) {
|
||||
precipitation: precip,
|
||||
precipitation_chance: precipChance,
|
||||
accumulation: precip,
|
||||
frost_risk: frostRisk(temp, dewPoint(temp, humidity), humidity),
|
||||
uv_index: uv,
|
||||
uv_index_max: uv,
|
||||
uv_dose: 0,
|
||||
|
||||
Reference in New Issue
Block a user