Skip to content

Text für Start des nächsten Zeitladen-Plans in Ladeprofil und Verbraucher - #3935

Merged
LKuemmel merged 3 commits into
openWB:masterfrom
LKuemmel:consumer_dev
Sep 14, 2026
Merged

LKuemmel merged 3 commits into
openWB:masterfrom
LKuemmel:consumer_dev

Conversation

@LKuemmel

Copy link
Copy Markdown
Contributor

No description provided.

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.

🟡 Changes recommended

Moderate findings remain in timeframe validation and both integration tests.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds German messages showing when the next scheduled time-charging plan starts for EV profiles and consumers.

Changes:

  • Calculates upcoming starts for daily, weekly, and one-time plans.
  • Formats German date/time messages.
  • Integrates and tests the message in EV and consumer charging paths.
File summaries
File Summary
packages/helpermodules/timecheck.py Calculates upcoming plan starts; complete timeframe validation is still needed.
packages/helpermodules/timecheck_test.py Tests upcoming starts for supported plan frequencies.
packages/control/text.py Formats German next-start messages.
packages/control/ev/charge_template.py Displays the next-start message for EV charging.
packages/control/ev/charge_template_test.py Moderate (1 vote): Patch the module-local formatter and assert a fixed sentinel.
packages/control/consumer/consumer.py Displays the next-start message for consumers.
packages/control/consumer/consumer_test.py Moderate (2 votes): Patch the module-local formatter and assert a fixed sentinel.
Review details

Suppressed comments (2)

packages/control/ev/charge_template_test.py:96

  • format_next_time_charging_start is imported directly into control.ev.charge_template, so patching control.text does not affect the function called by ChargeTemplate.time_charging; the assertion also calls the patched text function. This test can therefore pass without verifying that production invokes the formatter. Patch the module-local symbol and assert a fixed sentinel instead.
    monkeypatch.setattr(
        text,
        "format_next_time_charging_start",
        Mock(return_value="Nächster Zeitladen-Plan startet am 02.01. um 14:30 Uhr."),

packages/helpermodules/timecheck.py:168

  • This helper only parses the start field. A one-time plan whose end date is before its start (or whose end time is malformed) is rejected by check_timeframe, but this branch still returns its future start; daily/weekly plans with invalid end times have the same problem. Validate the complete timeframe before returning a candidate, otherwise the UI can report a start for a plan that can never run.
    start_hour, start_minute = _parse_plan_time(plan.time[0])

    if plan.frequency.selected == "once":
        begin_date = datetime.datetime.strptime(plan.frequency.once[0], "%Y-%m-%d")
  • Files reviewed: 7/7 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packages/control/consumer/consumer_test.py
LKuemmel and others added 2 commits September 14, 2026 10:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@LKuemmel
LKuemmel merged commit 323165e into openWB:master Sep 14, 2026
1 check 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.

2 participants