24h forecasting
This commit is contained in:
@@ -223,8 +223,10 @@ function summarise(slots) {
|
||||
}
|
||||
|
||||
export async function refreshForecast() {
|
||||
const sensors = await queryCurrent()
|
||||
const slots = await get24HourForecast(sensors)
|
||||
const sensors = await queryCurrent().catch(() => null)
|
||||
if (!sensors) return cache
|
||||
const slots = await get24HourForecast(sensors).catch(() => null)
|
||||
if (!slots) return cache
|
||||
cache = { ts: Date.now(), slots, summary: summarise(slots) }
|
||||
return cache
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user