Fix icons
This commit is contained in:
@@ -152,7 +152,7 @@ export async function get24HourForecast(currentSensors) {
|
||||
const wind_speed = forecastWind(seedWind, pressureTrend);
|
||||
|
||||
const celestial = getCelestialCurrent(coords.latitude, coords.longitude, time);
|
||||
const snapshot = {
|
||||
let snapshot = {
|
||||
time,
|
||||
temperature,
|
||||
humidity,
|
||||
@@ -167,7 +167,9 @@ export async function get24HourForecast(currentSensors) {
|
||||
...celestial
|
||||
};
|
||||
|
||||
return Object.assign(snapshot, getWeatherCondition(snapshot));
|
||||
Object.assign(snapshot, getWeatherCondition(snapshot));
|
||||
snapshot.icon = `/icons/${snapshot.icon}.png`;
|
||||
return snapshot;
|
||||
});
|
||||
|
||||
// Second pass — apply solar heating now that we have sun_elevation per slot
|
||||
@@ -213,7 +215,7 @@ function summarise(slots) {
|
||||
time: slots[0].time,
|
||||
label: dominant.label,
|
||||
code: dominant.code,
|
||||
icon: `/icons/${dominant.icon}.png`,
|
||||
icon: dominant.icon,
|
||||
temperature: Math.max(...temps),
|
||||
temperature_max: Math.max(...temps),
|
||||
temperature_min: Math.min(...temps),
|
||||
|
||||
@@ -36,6 +36,17 @@ function filterArr(arr, fields) {
|
||||
return arr.map(row => filterFields(row, fields));
|
||||
}
|
||||
|
||||
// ── Errors ────────────────────────────────────────────────────────────────────
|
||||
|
||||
app.use((req, res, next) => {
|
||||
res.status(404).json({ error: `Not found: ${req.method} ${req.path}` })
|
||||
})
|
||||
|
||||
app.use((err, req, res, next) => {
|
||||
console.error(`[ERROR] ${req.method} ${req.path}\n${err.stack}`)
|
||||
res.status(500).json({ error: err.message, stack: err.stack })
|
||||
})
|
||||
|
||||
// ── Current ───────────────────────────────────────────────────────────────────
|
||||
|
||||
app.get('/api/current', async (req, res) => {
|
||||
|
||||
Reference in New Issue
Block a user