Fix plugin loading error and improve code consistency - #1
Open
MiroStW wants to merge 9 commits into
Open
Conversation
added 5 commits
October 19, 2025 21:37
The duplicate 'variable plugin_name' inside the namespace was causing namespace resolution issues during plugin initialization. The plugin system uses the directory name to create the namespace, making this internal variable declaration redundant and problematic. This fixes the 'can't read ::plugins::de1_water_tracker_plugin::version' error that prevented the plugin from loading.
Replace namespace variable references with string literals for save_plugin_settings calls, matching the pattern used by other established plugins like advanced_rest_api. This makes the code more maintainable and consistent with DE1 plugin conventions.
Remove '_plugin' suffix from plugin name to follow naming conventions used by other established plugins (e.g., advanced_rest_api, mqtt). The directory should also be renamed from de1_water_tracker_plugin to de1_water_tracker when installing. This is a breaking change - users will need to: 1. Disable and remove the old de1_water_tracker_plugin 2. Install the renamed de1_water_tracker plugin
Implements the TODO item to notify users when a water usage threshold is reached. Features: - New setting for filter change reminder threshold (in L or gal) - Automatic notification popup when threshold is reached - Threshold respects current unit selection (L/gallons) - Notification flag resets when threshold is changed - UI input field with auto-conversion based on selected units - Done button saves threshold before closing settings The notification flag is reset when: - Counter is reset (allows notification for next cycle) - Threshold value is changed (allows notification at new threshold) Closes: TODO item 'Add a ping to let you know when a set total L/gal has been reached for filter change' Version bumped to 0.2 Tested and verified working: - UI properly spaced to avoid overlapping elements - Threshold saves correctly when Done button is clicked - Notification shows at correct threshold - Notification can be triggered again after changing threshold
- Add dedicated water_filter_warning page with dismiss button - Warning page displays once per filter cycle (until reset/threshold change) - More prominent and impossible to miss compared to popup - Follows DE1 conventions for message pages - Universal across all skins
Author
Update: Now includes filter notification featureThis PR has been updated to include all features from PR #2 (filter change reminder notifications) with recent improvements based on maintainer feedback. Complete Feature SetThis PR now includes: Bug Fixes (original):
New Feature (added):
The notification system now uses a dedicated warning page that requires user acknowledgment, making it impossible to miss - much better than the popup that quickly fades away. Note: PR #2 can be considered as a preview/testing branch for the notification feature, while this PR (main branch) represents the complete, production-ready plugin. |
added 4 commits
December 10, 2025 12:55
- Implemented 2-column layout for better space utilization - Left column: volume display and filter reminder settings - Right column: filter date and reset button - All elements left-aligned within their columns - Improved spacing between elements - Fixed Reset Counter button visibility
- Changed plugin name from de1_water_tracker to ro_filter_monitor - Updated display name from 'Water Usage Tracker' to 'RO Filter Monitor' - Updated all namespace references - Updated description to mention RO filters specifically - Renamed all page names and settings references
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 fixes a critical bug that prevented the plugin from loading and improves code consistency with other DE1 plugins. It also renames the plugin to follow naming conventions used by established plugins.
Problem
The plugin was failing to load with the error:
Changes
1. Fix: Remove duplicate plugin_name variable declaration
The duplicate
variable plugin_nameinside the namespace was causing namespace resolution issues during plugin initialization. The plugin system uses the directory name to create the namespace, making this internal variable declaration redundant and problematic.2. Refactor: Simplify save_plugin_settings calls
Replace namespace variable references with string literals, matching the pattern used by established plugins like
advanced_rest_api. This makes the code more maintainable and consistent with DE1 plugin conventions.3. Refactor: Rename plugin to de1_water_tracker
Remove the
_pluginsuffix to follow naming conventions used by other established plugins (e.g.,advanced_rest_api,mqtt,visualizer_upload).de1_water_tracker_plugintode1_water_tracker. Users will need to:de1_water_tracker_pluginde1_water_trackerpluginTesting
✅ Tested on DE1 production environment
✅ Plugin now loads successfully and appears correctly in the Extensions list
✅ All plugin functionality working as expected
✅ Directory rename tested and working
Reference
Code pattern comparison with working plugin
advanced_rest_apiconfirmed the best practices used in this fix.