Fix slot boundary alignment for evaluation window end-time log#280
Merged
Fix slot boundary alignment for evaluation window end-time log#280
Conversation
Co-authored-by: MaStr <1036501+MaStr@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update default logic log messages based on feedback
Fix slot boundary alignment for evaluation window end-time log
Feb 25, 2026
MaStr
approved these changes
Feb 25, 2026
MaStr
added a commit
that referenced
this pull request
Feb 25, 2026
* Fixing wrong debug msg: "hour" Changeing logic messages from hour to "slots". Adding a message to show interval at the beginning of evaluation * Changing more messages hours -> slots * Update docstring to replace "high price hours" with "high price slots" * Get rid of excessive recharge below threshold mesage * Fix refactor mistake * Update src/batcontrol/logic/default.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/batcontrol/logic/default.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/batcontrol/logic/default.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/batcontrol/logic/default.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Fix PEP8 whitespace: remove extra spaces in parentheses (#279) * Initial plan * Fix PEP8 whitespace: remove extra spaces in append(slot) call Co-authored-by: MaStr <1036501+MaStr@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MaStr <1036501+MaStr@users.noreply.github.com> * Fix slot boundary alignment for evaluation window end-time log (#280) * Initial plan * Fix last_time calculation to align to slot boundary Co-authored-by: MaStr <1036501+MaStr@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MaStr <1036501+MaStr@users.noreply.github.com> * Add feedback * Use singal slot in loop over plural form * Update src/batcontrol/core.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * remove entry message on run() * Some other cleanups and formatting issues * Review Feedack added * Review feedback * Update src/batcontrol/logic/common.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: MaStr <1036501+MaStr@users.noreply.github.com>
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.
last_timein the "Evaluating next N slots until HH:MM" log was computed from the rawcalc_timestamp(e.g. 14:23:45) rather than the start of the current slot, producing an off-boundary, misleading time — especially for 15-minute intervals.Changes
src/batcontrol/logic/default.py: Replace thedisplay_minutes/t0/t1computation with slot-aligned arithmetic:slot_start— floorcalc_timestampto the nearestinterval_minutesboundary (zero seconds/microseconds)last_time—slot_start + max_slots * interval_minutes, the true end of the evaluation window🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.