fix forecast graf
All checks were successful
deploy / deploy (push) Successful in 1m30s
test / smoke-test (push) Successful in 7s

This commit is contained in:
Dusan Vojacek
2026-04-12 20:55:10 +02:00
parent 3066a82265
commit f7d3162eb7
2 changed files with 32 additions and 17 deletions

View File

@@ -1025,7 +1025,13 @@ async def get_site_forecast_pv(
JOIN ems.asset_pv_array apa
ON apa.id = fpr.pv_array_id AND apa.site_id = fpr.site_id
WHERE fpr.site_id = $1
AND fpi.interval_start::date = $2::date
AND (
fpi.interval_start
AT TIME ZONE COALESCE(
(SELECT timezone FROM ems.site WHERE id = $1),
'Europe/Prague'
)
)::date = $2::date
AND fpr.status = 'ok'
ORDER BY fpi.interval_start, fpr.pv_array_id, fpr.created_at DESC
) latest