Repository navigation
Feature fix charge costs - #4110
Merged
LKuemmel merged 8 commits intoOct 20, 2026
Merged
Conversation
* fix chargelog energy source calculation * Add Test
* Improve Log * Move generate_totals-Logger in logger.py * Fix * Fix Circular Import * Update .gitignore * fix * Ensure ramdisk folder exists * retrigger Copilot * Add Copilot suggestions * fix
* fix chargelog energy source calculation * Add Test
AlexanderHa98
force-pushed
the
feature_fix_charge_costs_PR
branch
from
October 14, 2026 10:34
59ef992 to
3ec5473
Compare
This was referenced Oct 14, 2026
Open
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Cost snapshots introduce an unnecessary synchronous SmartHome collection wait that delays charging regulation.
1 open issue
What changed in this PR
Improves charging-cost accounting by using live measurements at finalization and including small positive charging amounts.
Changes:
- Extracts shared measurement-entry construction.
- Uses live snapshots for final charging intervals.
- Adds charging-cost and energy-source regression tests.
| File | Description |
|---|---|
| packages/helpermodules/measurement_logging/write_log.py | Delegates entry construction to the shared builder. |
| packages/helpermodules/measurement_logging/write_log_test.py | Updates imports for extracted functionality. |
| packages/helpermodules/measurement_logging/process_log_unit_test.py | Adds energy-source calculation coverage. |
| packages/helpermodules/measurement_logging/process_log_entry_builder.py | Houses shared snapshot construction and value correction. |
| packages/helpermodules/measurement_logging/process_log_calculation.py | Adjusts spacing and comment placement without changing behavior. |
| packages/helpermodules/data_migration/data_migration.py | Updates the SmartHome collector import. |
| packages/control/chargelog/chargelog.py | Uses live finalization snapshots and counts small charging amounts. |
| packages/control/chargelog/chargelog_test.py | Tests live snapshots and small charging amounts. |
Review effort: Balanced
| entries_day_before = get_daily_log(date_day_before)["entries"] | ||
| previous_entry = entries_day_before[-1] | ||
|
|
||
| current_entry = create_entry(LegacySmartHomeLogData(), previous_entry) |
LKuemmel
approved these changes
Oct 20, 2026
buhito81
added a commit
to buhito81/core
that referenced
this pull request
Oct 20, 2026
openWB#4110 hat create_entry nach process_log_entry_builder.py verschoben: die tariff_name-Zeilen stehen jetzt dort, write_log.py übernimmt die master-Seite. chargelog_test.py: beide Seiten behalten, dazu ein Test, dass das angebrochene letzte Intervall den Tarifzeitraum der aktuellen Messung bekommt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LKuemmel
pushed a commit
that referenced
this pull request
Oct 22, 2026
* Keep small charged energy amounts (#3905) * Fix charge cost calc (#4022) * fix chargelog energy source calculation * Add Test * Improve Monthly/Yearly Log (#3829) * Improve Log * Move generate_totals-Logger in logger.py * Fix * Fix Circular Import * Update .gitignore * fix * Ensure ramdisk folder exists * retrigger Copilot * Add Copilot suggestions * fix * Fix charge cost calc (#4022) * fix chargelog energy source calculation * Add Test * fix circular error * Remove duplicate function * Revert previous change * Add copilot suggestion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

No description provided.