fix build
Some checks failed
CI and deploy / migration-check (push) Failing after 12s
CI and deploy / deploy (push) Has been skipped

This commit is contained in:
Dusan Vojacek
2026-05-05 10:49:40 +02:00
parent 5b383e9028
commit d54579e3b1

View File

@@ -188,31 +188,6 @@ function isForecastExtensionInterval(i: PlanningIntervalDto): boolean {
)
}
function syntheticForecastOnlyInterval(
interval_start: string,
pv_forecast_total_w: number | null,
): PlanningIntervalDto {
return {
interval_start,
battery_setpoint_w: null,
battery_soc_target_pct: null,
grid_setpoint_w: null,
export_limit_w: null,
export_mode: null,
deye_physical_mode: null,
ev1_setpoint_w: null,
ev2_setpoint_w: null,
heat_pump_enabled: null,
pv_a_curtailed_w: null,
expected_cost_czk: null,
effective_buy_price: null,
effective_sell_price: null,
is_predicted_price: false,
pv_forecast_total_w,
load_baseline_w: null,
}
}
function pvAProxyW(i: PlanningIntervalDto): number {
const pv = i.pv_forecast_total_w
if (pv != null && pv > 0) return pv
@@ -625,7 +600,6 @@ export default function Planning() {
const [selectedStart, setSelectedStart] = useState<string | null>(null)
const [tableHorizonH, setTableHorizonH] = useState<HorizonHours>(48)
const [chartHorizonH, setChartHorizonH] = useState<HorizonHours>(48)
const [forecastRefreshKey, setForecastRefreshKey] = useState(0)
const load = useCallback(async () => {
if (siteId == null) return
@@ -723,7 +697,6 @@ export default function Planning() {
try {
await postRunPlan(siteId, 'rolling')
await load()
setForecastRefreshKey((k) => k + 1)
} catch (e) {
setError(axiosDetail(e) || 'Přepočet selhal')
} finally {
@@ -765,7 +738,6 @@ export default function Planning() {
try {
const r = await postRunForecast(siteId)
toast.success(`Forecast: ${r.intervals_saved} intervalů, ${r.pv_arrays} FVE polí`)
setForecastRefreshKey((k) => k + 1)
await runRollingReload()
} catch (e) {
toast.error('Forecast selhal', { description: axiosDetail(e) })
@@ -789,7 +761,6 @@ export default function Planning() {
)
const fc = await postRunForecast(siteId)
toast.success(`Forecast: ${fc.intervals_saved} intervalů, ${fc.pv_arrays} FVE polí`)
setForecastRefreshKey((k) => k + 1)
await runRollingReload()
toast.success('Plán přepočítán (rolling).')
} catch (e) {