Skip to content

fix(web): save the weather provider and PV rated power you choose - #1437

Merged
frahlg merged 1 commit into
masterfrom
fix/weather-settings-save
Sep 25, 2026
Merged

frahlg merged 1 commit into
masterfrom
fix/weather-settings-save

Conversation

@frahlg

@frahlg frahlg commented Sep 25, 2026

Copy link
Copy Markdown
Member

Fixes #1436.

Problem

On v0.136.3-beta.1, segran2 chose met_no and 10000 W under Settings › Weather and saved. The stored config kept "provider": "" and no pv_rated_w. Core therefore fetched no forecast, and the Plan showed a PV forecast of 0 kWh.

Cause: 76f811b made Save store only fields whose value differs from what was rendered, so displayed defaults do not become settings. That rule assumes a displayed default is Core's default. Weather broke that assumption:

  • An empty provider matches no <option>, so the browser shows the first one, met_no.
  • A missing pv_rated_w rendered the field default 10000.

Core uses neither value when the setting is missing. Accepting what the form showed was therefore "unchanged", and nothing was stored.

Change

  • selectField: a stored value that is not one of the options shows the declared default, not the first option.
  • Weather: the provider default is none, since Core starts no forecast without a provider. The PV rated field is empty when unset, since Core uses 0 then. It has a help text saying the solar forecast needs it or PV arrays.

Evidence

  • Tests. Web tests shows a select's default when the stored value is not an option and shows no provider and no rated power when none is set fail on master and pass here. npm test passes 638/638 with LANG=C. With a Swedish locale, update-dialog.test.mjs fails on master too, because it formats "8 192".
  • Browser, local Core with the reporter's config (provider: "", a location, no rated power):
    • master web: the form shows provider=met_no pv_rated_w="10000". Saving without changes stores {"provider":"","latitude":55.8953,"longitude":13.4023}.
    • this branch: the form shows provider=none pv_rated_w="". After choosing met_no and entering 10000, Save stores {"provider":"met_no",…,"pv_rated_w":10000}.

Screenshot of the branch's Weather tab: provider none, PV rated empty, with help.

Not changed: whether Core should start met_no by itself for a site that has a location but no provider. That is a cold-start product choice for the owner.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7

Settings › Weather showed met_no and 10000 W when neither was set. An
empty provider matched no option, so the browser showed the first one,
and a missing rating showed the field's default. Save stores only fields
that differ from what was rendered, so accepting what the form showed
stored nothing: Core kept no provider and no rated power, and the site
had no solar forecast.

The form now shows what Core uses: no provider and an empty rated power.
A select whose stored value is not one of its options shows its default
instead of the first option.

Fixes #1436.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MuerPFZFG88kgu8sWVHeq7
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-25T11:42:21.644880Z 4f52896 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@frahlg
frahlg merged commit 8d6da58 into master Sep 25, 2026
12 checks passed
@frahlg
frahlg deleted the fix/weather-settings-save branch September 25, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Weather/PV-inställningarna sparades inte från UI:t. I

1 participant