Add component error tracking and web UI display#3069
Merged
springfall2008 merged 1 commit intomainfrom Dec 15, 2025
Merged
Conversation
- Add get_error_count() method to ComponentBase for tracking errors - Enhance error handling in component start() loop to count failures - Add non_fatal_error_occurred() method to notify base system - Add get_error_count() method to Components class - Display error count on component cards in web UI with color coding - Add error_count to status entity attributes for persistence - Add component_error_count to predbat.components entity - Add CSS styling for error count display (light and dark mode) - Remove debug logging from Octopus API run method Error counts are displayed in green (0 errors) or red (>0 errors) on the Components page, providing immediate visual feedback on component health.
5 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive error tracking for Predbat components with visual display in the web UI. The implementation tracks both component-level errors (new) and enhances the main status error count to persist across restarts. Error counts are displayed in the web interface with color coding (green for no errors, red for errors) to provide immediate visibility into component health.
Key Changes
- Component error tracking infrastructure in
ComponentBasewith automatic increment on run failures and exceptions - Error count retrieval methods in
Componentsclass with defensive null checks - Enhanced web UI to display component error counts with color-coded visual feedback
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
apps/predbat/component_base.py |
Added get_error_count() method and error tracking in start() loop with non_fatal_error_occurred() notification |
apps/predbat/components.py |
Added get_error_count(name) method to retrieve component error counts with null safety checks |
apps/predbat/output.py |
Enhanced record_status() to persist main status error count across restarts |
apps/predbat/predbat.py |
Integrated component error counts into health monitoring and entity attributes |
apps/predbat/web.py |
Added error count display to component cards with conditional color coding |
apps/predbat/web_helper.py |
Added CSS classes for error count styling in both light and dark modes |
apps/predbat/octopus.py |
Removed noisy debug logging from run method |
iangregory
pushed a commit
to iangregory/batpred
that referenced
this pull request
Dec 24, 2025
- Add get_error_count() method to ComponentBase for tracking errors - Enhance error handling in component start() loop to count failures - Add non_fatal_error_occurred() method to notify base system - Add get_error_count() method to Components class - Display error count on component cards in web UI with color coding - Add error_count to status entity attributes for persistence - Add component_error_count to predbat.components entity - Add CSS styling for error count display (light and dark mode) - Remove debug logging from Octopus API run method Error counts are displayed in green (0 errors) or red (>0 errors) on the Components page, providing immediate visual feedback on component health.
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.
Summary
This PR adds comprehensive error tracking for all Predbat components with visual display in the web UI.
Changes
Component Base Class (
component_base.py)get_error_count()method to return error count for each componentstart()loop to callnon_fatal_error_occurred()on failuresnon_fatal_error_occurred()method to notify base system of errorscount_errors) is incremented on both run failures and exceptionsComponents Class (
components.py)get_error_count(name)method to retrieve error counts for specific componentsOutput Module (
output.py)record_status()method to track and persist error count in status entity attributesMain Predbat (
predbat.py)component_error_counttracking in component health monitoringpredbat.componentsentity attributesWeb Interface (
web.py)Web Helper CSS (
web_helper.py).error-count-noneclass (green) for components with no errors.error-count-highclass (red) for components with errorsOctopus API (
octopus.py)Features
Testing
Screenshots
Error counts are displayed on each component card in the Components view, providing immediate visibility into component health and making it easier to identify components experiencing issues.