Repository navigation
Keep the full ENTSO-E price region when saving configuration - #1273
Merged
Merged
Conversation
#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]>
🔧 PR Build ArtifactsVersion: All environments built successfully. Download the zip files:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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::priceRegionfromStringtochar[8]. The config save handler copies the submittedprargument through that buffer intoPriceServiceConfig.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 shortNOxScodes 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 asPriceServiceConfig.area.Verification:
pio run -e esp32andpio run -e esp8266both 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/configfileshould show the fullpriceArea.🤖 Generated with Claude Code