Added daytime property
This commit is contained in:
@@ -41,13 +41,12 @@ function filterArr(arr, fields) {
|
||||
app.get('/api/current', async (req, res) => {
|
||||
const { fields } = req.query
|
||||
const [sensors, coords] = await Promise.all([queryCurrent(), getCoords()])
|
||||
const condition = getWeatherCondition(sensors)
|
||||
const space = getCelestialCurrent(coords.latitude, coords.longitude)
|
||||
const condition = getWeatherCondition(Object.assign(sensors, space))
|
||||
const { summary } = await ensureForecast()
|
||||
|
||||
// Merge forecast summary fields — sensor readings take priority
|
||||
const merged = {
|
||||
time: new Date(),
|
||||
...(summary ? {
|
||||
precipitation_chance: summary.precipitation_chance,
|
||||
temperature_max: summary.temperature_max,
|
||||
|
||||
Reference in New Issue
Block a user