Skip to content

fixed hours: move weekdays misplaced by upgrade 133 into active_times - #4260

Merged
LKuemmel merged 2 commits into
openWB:masterfrom
buhito81:fix_fixed_hours_weekdays
Nov 11, 2026
Merged

LKuemmel merged 2 commits into
openWB:masterfrom
buhito81:fix_fixed_hours_weekdays

Conversation

@buhito81

@buhito81 buhito81 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

fixes #4259

upgrade_datastore_133 hat weekdays neben statt in active_times angelegt, fixed_hours liest active_times["weekdays"] → KeyError('weekdays') für alle Festen Tarifstunden aus 2.2.x. upgrade_datastore_157 repariert bereits migrierte Konfigurationen (wie upgrade_datastore_155 die Prioritätsfelder):

  • Stromtarif und Netzentgelt (fixed_hours)
  • weekdays neben active_times wird entfernt, fehlende active_times["weekdays"] = alle Tage (so legt es 133 an)
  • in der Oberfläche schon nachgetragene Wochentage bleiben
  • andere Anbieter unverändert, ein zweiter Durchlauf ändert nichts

Getestet per pytest (zusätzlich: 2.2.2-Konfiguration durch 133-157, danach liefert der Abruf Preise), nicht auf einer Box.

Summary by Sourcery

Fix fixed-hours tariff configurations so migrated weekday schedules can be read without errors.

Bug Fixes:

  • Repair fixed-hours tariff configurations migrated by datastore upgrade 133 so weekdays are stored under active_times and missing weekdays default to all days.

Enhancements:

  • Advance the datastore schema version to 157 and make the migration idempotent while preserving existing active-time weekdays and leaving other provider types unchanged.

Tests:

  • Add coverage for migrating flexible tariffs and grid fees, preserving existing weekdays, ignoring other providers, and avoiding changes on repeated runs.

upgrade_datastore_156 is now the Energy-Charts price cap (openWB#4284); the weekdays repair moves to 157.
@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Bump the datastore version and add migration 157 to move misplaced fixed-hours weekdays into active_times while preserving existing selections and leaving other providers untouched.

  • packages/helpermodules/update_config.py L66, L4209-4234

Tests

Test the migration’s weekday repair, idempotence, and handling of providers that should remain unchanged.

  • packages/helpermodules/update_config_test.py L439-491

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai

sourcery-ai Bot commented Nov 10, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit 0226c7c

#4259 [BUG] Feste Tarifstunden nach Update 2.2.x → 2.3.0: Fehler 'weekdays', keine Preise · 1 of 1 met

# Requirement Status Notes
1 Fix the missing-weekdays error so migrated fixed-hours electricity tariffs and grid fees can provide prices. ✅ Met Upgrade 157 handles both provider topics and adds all weekdays to active_times when they are missing.

@LKuemmel
LKuemmel merged commit e4dcbc8 into openWB:master Nov 11, 2026
2 checks passed
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.

[BUG] Feste Tarifstunden nach Update 2.2.x → 2.3.0: Fehler 'weekdays', keine Preise

2 participants