close
Skip to content

Fixes PUN tariff not loading if next day data is not yet available.#29092

Merged
andig merged 2 commits into
evcc-io:masterfrom
MobilettoSoft:master
Apr 13, 2026
Merged

Fixes PUN tariff not loading if next day data is not yet available.#29092
andig merged 2 commits into
evcc-io:masterfrom
MobilettoSoft:master

Conversation

@MobilettoSoft
Copy link
Copy Markdown
Contributor

Fixes #29066. The GME website usually doesn't publish data for the next day until 13.00 CET; this slows down the startup because the code keeps retrying before giving up and prevents the tariff to load.
With this fix, when retrieving data for the next day, if the server responds with a 404 error, the code stops trying and loads the tariff only with the data of the current day.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider centralizing the special handling of ErrPunDataNotAvailable (e.g., inside backoffPermanentError or a dedicated helper) so the logic for which errors are treated as permanent is not split between the retry closure and the outer error check.
  • It may be helpful to expand the comment near the ErrPunDataNotAvailable handling to clarify that this specific error is intentionally treated as non-fatal for the overall run (no log, no done signal) to avoid retries when next-day data isn’t yet published.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider centralizing the special handling of `ErrPunDataNotAvailable` (e.g., inside `backoffPermanentError` or a dedicated helper) so the logic for which errors are treated as permanent is not split between the retry closure and the outer error check.
- It may be helpful to expand the comment near the `ErrPunDataNotAvailable` handling to clarify that this specific error is intentionally treated as non-fatal for the overall run (no log, no `done` signal) to avoid retries when next-day data isn’t yet published.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@andig andig added the tariffs Specific tariff support label Apr 13, 2026
@andig andig enabled auto-merge (squash) April 13, 2026 17:16
@andig andig merged commit 884f183 into evcc-io:master Apr 13, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tariffs Specific tariff support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PUN Tariff not loading when next day data is not yet available

2 participants