Skip to content

Add prices to text description, disable left over debug text #2405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 31, 2025

Conversation

springfall2008
Copy link
Owner

No description provided.

@springfall2008 springfall2008 requested a review from Copilot May 31, 2025 18:04
Copy link
Contributor

@Copilot 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 the logging and textual output to remove leftover debug messages and add price estimations in user-facing text.

  • Removed an unguarded debug log in plan.py and added conditional logging based on self.debug_enable.
  • Enhanced the output message in output.py to include estimated bill amounts for today and tomorrow, and updated the string concatenation for import rate details.

Reviewed Changes

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

File Description
apps/predbat/plan.py Removed an extraneous debug log and wrapped a debug log call with a condition.
apps/predbat/output.py Added calculations and formatting for price estimates; adjusted string concatenation for import rate details.

Comment on lines +826 to +827
midnight_today_minute = 24 * 60 - self.minutes_now
midnight_tomorrow_minute = 24 * 60 + midnight_today_minute
Copy link
Preview

Copilot AI May 31, 2025

Choose a reason for hiding this comment

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

Consider defining a named constant (e.g., MINUTES_IN_DAY) instead of using the magic number '24 * 60' to improve code readability and maintainability.

Suggested change
midnight_today_minute = 24 * 60 - self.minutes_now
midnight_tomorrow_minute = 24 * 60 + midnight_today_minute
midnight_today_minute = MINUTES_IN_DAY - self.minutes_now
midnight_tomorrow_minute = MINUTES_IN_DAY + midnight_today_minute

Copilot uses AI. Check for mistakes.

@springfall2008 springfall2008 merged commit 5157f89 into main May 31, 2025
1 check passed
@springfall2008 springfall2008 deleted the fixes branch May 31, 2025 18:05
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.

1 participant