Skip to content

Rework default logic log messages#278

Merged
MaStr merged 19 commits intomainfrom
issue-275
Feb 25, 2026
Merged

Rework default logic log messages#278
MaStr merged 19 commits intomainfrom
issue-275

Conversation

@MaStr
Copy link
Owner

@MaStr MaStr commented Feb 25, 2026

As stated in #275 , there are multiple occasions, where the logmessages tells "hour", but in fact it is working on 15 minutes.
That was adjusted.

In addition some odd logic messages, when having no recharge energy defined are left out.

@MaStr MaStr self-assigned this Feb 25, 2026
Copilot AI review requested due to automatic review settings February 25, 2026 10:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Batcontrol’s default logic logging to better reflect 15-minute operation (time “slots” instead of “hours”) and reduces some confusing recharge-related log output, aligning with issue #275.

Changes:

  • Reworded multiple default-logic debug messages from “hours” to “slots” and updated related docstrings.
  • Adjusted displayed evaluation-window timestamps for slot-based evaluation logging.
  • Added cycle-start logging in the main Batcontrol.run() loop.

Reviewed changes

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

File Description
src/batcontrol/logic/default.py Renames hour-based terms to slot-based terms in logs/docstrings and tweaks recharge/discharge evaluation logging behavior.
src/batcontrol/core.py Adds log lines at the start of each evaluation cycle, including the configured time resolution.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 25, 2026 10:59
MaStr and others added 2 commits February 25, 2026 11:59
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Feb 25, 2026

@MaStr I've opened a new pull request, #279, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Feb 25, 2026

@MaStr I've opened a new pull request, #280, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Copilot AI and others added 2 commits February 25, 2026 12:27
* 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>
* 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>
Copilot AI review requested due to automatic review settings February 25, 2026 11:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Copilot AI review requested due to automatic review settings February 25, 2026 11:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 25, 2026 11:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/batcontrol/logic/default.py:422

  • After computing recharge_energy = required_energy - stored_usable_energy, the code no longer short-circuits when recharge_energy <= 0. That means a negative/zero recharge_energy flows into the free-capacity/min-threshold logic and can trigger the "below threshold" debug message even though no charging is needed. Add an early return (and/or a dedicated debug message) when recharge_energy <= 0.0 to keep logs and control flow consistent with the intended meaning.
        free_capacity = calc_input.free_capacity

        if recharge_energy > free_capacity:
            recharge_energy = free_capacity
            logger.debug(

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 25, 2026 12:29
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

@MaStr MaStr merged commit f25d7e6 into main Feb 25, 2026
17 checks passed
@MaStr MaStr deleted the issue-275 branch February 25, 2026 12:42
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.

3 participants