Skip to content

Fix manual override plan display, web interface download plan/apps use text format#3453

Merged
springfall2008 merged 2 commits intomainfrom
fixes3
Feb 28, 2026
Merged

Fix manual override plan display, web interface download plan/apps use text format#3453
springfall2008 merged 2 commits intomainfrom
fixes3

Conversation

@springfall2008
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 28, 2026 16:06
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

Improves the Predbat web UI by fixing manual override highlighting for plan rows that fall on the next day, and adjusts debug/download endpoints to deliver files in a more user-friendly “text” download format.

Changes:

  • Update plan renderer JS to compute absolute minutes-from-midnight across day boundaries (so next-day slots compare correctly with override minute lists).
  • Serve debug downloads (apps.yaml / debug yaml / logs) with .txt filenames and support merging multiple log files into one download.
  • Add a favicon link to the HTML header.

Reviewed changes

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

File Description
apps/predbat/web_helper.py Fixes override time comparison for next-day plan slots by computing absolute minutes using a plan “midnight reference”; adds favicon link.
apps/predbat/web.py Updates debug download endpoints to use .txt filenames; enhances file download helper to optionally merge two files (used for logs).


async def html_debug_log(self, request):
return await self.html_file_load("predbat.log")
return await self.html_file_load("predbat.1.log", also_file="predbat.log", as_file="predbat.log.txt")
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

html_debug_log() currently loads predbat.1.log as the primary file and then prepends predbat.log via also_file, which produces a combined download with the newest log first and the rotated (older) log last. This is the reverse of the ordering used in html_api_get_log() (which prepends predbat.1.log before predbat.log) and makes the merged log non-chronological. Swap the arguments (load predbat.log and also_file="predbat.1.log") or adjust the concatenation order so older entries come first.

Suggested change
return await self.html_file_load("predbat.1.log", also_file="predbat.log", as_file="predbat.log.txt")
return await self.html_file_load("predbat.log", also_file="predbat.1.log", as_file="predbat.log.txt")

Copilot uses AI. Check for mistakes.
@springfall2008 springfall2008 merged commit bf04cb3 into main Feb 28, 2026
5 checks passed
@springfall2008 springfall2008 deleted the fixes3 branch February 28, 2026 16:15
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