close
Skip to content

Tariffs: update Pstryk API integration for pricing metrics#28983

Merged
andig merged 2 commits into
evcc-io:masterfrom
redzioch:fix/pstryk-tarrif-update
Apr 10, 2026
Merged

Tariffs: update Pstryk API integration for pricing metrics#28983
andig merged 2 commits into
evcc-io:masterfrom
redzioch:fix/pstryk-tarrif-update

Conversation

@redzioch
Copy link
Copy Markdown
Contributor

@redzioch redzioch commented Apr 9, 2026

Fix #28982

Pstryk changed their API since 01.04.2026.

Endpoints used in evcc no longer exist. Updated tariff template to match updated API.

Tested with newest stable binary (https://github.com/evcc-io/evcc/blob/411f194645b522e6221fd7d588e8b57f8c59e628/CONTRIBUTING.md#device-templates) - works.

@redzioch redzioch marked this pull request as ready for review April 9, 2026 20:57
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:

  • The window_start and window_end query parameters build slightly different timestamp formats (2006-01-02T15 vs 2006-01-02), which may lead to inconsistent or invalid ISO8601 values; consider aligning both to the same YYYY-MM-DDTHH:MM:SSZ pattern.
  • The jq filter uses select(.metrics.pricing != null) which will error if metrics is missing; consider a safer pattern like select((.metrics // {}) | .pricing != null) to make the parsing more robust to partial responses.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The `window_start` and `window_end` query parameters build slightly different timestamp formats (`2006-01-02T15` vs `2006-01-02`), which may lead to inconsistent or invalid ISO8601 values; consider aligning both to the same `YYYY-MM-DDTHH:MM:SSZ` pattern.
- The `jq` filter uses `select(.metrics.pricing != null)` which will error if `metrics` is missing; consider a safer pattern like `select((.metrics // {}) | .pricing != null)` to make the parsing more robust to partial responses.

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.

@redzioch redzioch mentioned this pull request Apr 9, 2026
2 tasks
@andig
Copy link
Copy Markdown
Member

andig commented Apr 10, 2026

Solves #28982

@redzioch GH doesn't recognize this. Working must be "Fix(es)" for linking to work ;)

@andig andig added the tariffs Specific tariff support label Apr 10, 2026
@andig andig merged commit 28d2e1e into evcc-io:master Apr 10, 2026
13 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.

Pstryk tariff integration broken

2 participants