Skip to content

Keep the full ENTSO-E price region when saving configuration - #1273

Merged
gskjold merged 1 commit into
mainfrom
fix/price-region-truncated
Oct 1, 2026
Merged

gskjold merged 1 commit into
mainfrom
fix/price-region-truncated

Conversation

@gskjold

@gskjold gskjold commented Oct 1, 2026

Copy link
Copy Markdown
Member

Reported in the v2.6 beta discussion (#1270) by @matlab22 and @ArnieO: after saving the configuration, the selected price region disappears and the price service reports an error. Downgrading to v2.5.7 fixes it.

Cause: #1169 changed AmsWebServer::priceRegion from String to char[8]. The config save handler copies the submitted pr argument through that buffer into PriceServiceConfig.area, so every 16-character ENTSO-E code was cut down to 7 characters (10YCH-SWISSGRIDZ → 10YCH-S). The stored region then matches no option in the region list, and price fetching fails. Only the short NOxS codes made it through intact. It shows up as soon as settings are saved, which matches the reports.

Fix: make the buffer char[17], the same size as PriceServiceConfig.area.

Verification: pio run -e esp32 and pio run -e esp8266 both build. Not yet tested on a device. To check: pick e.g. Switzerland or SE3, untick price fetch, save, reload. The region should still be selected, and /configfile should show the full priceArea.

🤖 Generated with Claude Code

#1169 changed the web server's priceRegion from String to char[8], but
ENTSO-E area codes are 16 characters. Saving the configuration copied
the submitted region through this buffer into PriceServiceConfig.area,
so the stored region was truncated (e.g. "10YCH-S"), no longer matched
any option in the region list, and price fetching failed. Size the
buffer to match PriceServiceConfig.area.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

🔧 PR Build Artifacts

Version: 04afb6b

All environments built successfully. Download the zip files:

Artifacts expire after 7 days. View workflow run

@gskjold
gskjold merged commit 315775c into main Oct 1, 2026
8 checks passed
@gskjold
gskjold deleted the fix/price-region-truncated branch October 1, 2026 08:47
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.

1 participant