Skip to content

Add Naturstrom - #3695

Draft
AlexanderHa98 wants to merge 4 commits into
openWB:masterfrom
AlexanderHa98:feature_Naturstrom-tariffs
Draft

Add Naturstrom#3695
AlexanderHa98 wants to merge 4 commits into
openWB:masterfrom
AlexanderHa98:feature_Naturstrom-tariffs

Conversation

@AlexanderHa98

@AlexanderHa98 AlexanderHa98 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new “Naturstrom” flexible electricity tariff provider module to the electricity pricing subsystem, including configuration models and runtime fetching/refresh logic.

Changes:

  • Introduces Naturstrom tariff fetching, including OAuth refresh-token handling and publishing refreshed tokens back into config.
  • Adds Naturstrom provider configuration dataclasses (token + account identification + update schedule).
  • Registers the provider package via an (empty) module initializer.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 7 comments.

File Description
packages/modules/electricity_pricing/flexible_tariffs/naturstrom/tariff.py Implements token validation/refresh and price retrieval/parsing for Naturstrom.
packages/modules/electricity_pricing/flexible_tariffs/naturstrom/config.py Adds dataclass-based configuration for Naturstrom (token, account, update_hours).
packages/modules/electricity_pricing/flexible_tariffs/naturstrom/init.py Initializes the Naturstrom provider package.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/modules/electricity_pricing/flexible_tariffs/naturstrom/tariff.py Outdated
'stop': end_of_today.isoformat(),
}
return req.get_http_session().get(
f"https://naturstrom-staging.powerquartier.de/api/public/accounts/{config.configuration.account_id}/rate",
}
try:
token_data = req.get_http_session().post(
'https://naturstrom-staging.powerquartier.de/api/public-auth/oauth2/token',
Comment thread packages/modules/electricity_pricing/flexible_tariffs/naturstrom/tariff.py Outdated
Comment thread packages/modules/electricity_pricing/flexible_tariffs/naturstrom/tariff.py Outdated
Comment thread packages/modules/electricity_pricing/flexible_tariffs/naturstrom/tariff.py Outdated
Comment thread packages/modules/electricity_pricing/flexible_tariffs/naturstrom/config.py Outdated
Comment thread packages/modules/electricity_pricing/flexible_tariffs/naturstrom/config.py Outdated
Comment thread packages/modules/electricity_pricing/flexible_tariffs/naturstrom/tariff.py Outdated
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.

4 participants