Fertigation implementation#284
Open
LuisMMMTS wants to merge 11 commits into
Open
Conversation
- Add fertigation support detection in supported.js - Fix dates.js to handle fertigation format (date range at index 7 when fertigation exists) - Fix programs.js to parse program array correctly (fertigation at index 5, name at index 6, date range at index 7) - Fix all program name reads to use correct index based on fertigation support - Add fertigation station API support in stations.js - Add fertigation station UI in options.js - Update sites.js to cache fertigation station from /ja endpoint - Update firmware.js to recognize /cf and /pf endpoints as change commands - Maintain backward compatibility with older firmware versions
- Fix sites.js to correctly extract fertigation data from nested /ja response structure - Update supported.js to check for fertigation object existence rather than just fert_station property - Only initialize fertigation data if backend actually returns it (firmware support check)
- Add try-catch around fertigation support check in options.js - Improve null/undefined checks in sites.js and supported.js - Add comments explaining backend always includes fertigation section
- Add console.log statements to track fertigation data loading and support detection - This will help identify if data is being loaded correctly from /ja endpoint
…ected - Change logic to always show fertigation station selector if controller is connected - Backend will handle unsupported cases gracefully - This ensures the UI is visible even if data hasn't loaded yet
- Remove complex connection checks - Simply check if controller.stations.snames exists - Add detailed console logging to debug why it might not show
- Remove all conditions - always add fertigation HTML - Add extensive console logging - This will help identify if the code is even running
- Remove console.log statements - Keep the always-show logic since fertigation data is loading correctly - The selector should now appear in the options page
- Add console.log statements to track execution - Log current fertigation station, station count, and when HTML is added - This will help identify if the code is running and what data is available
- Remove separate fertigation icon, use settings icon with 'F' instead - Make fertigation station behave like master station (no status line, no group ID) - Update CSS to display larger, clearer 'F' icon matching master icon style - Fix fertigation settings save/load format (convert percentage to seconds) - Remove all debug console.log statements - Make fertigation station text translatable using OSApp.Language._()
- Replace repeated `OSApp.Supported && OSApp.Supported.fertigation &&
OSApp.Supported.fertigation()` triple guard (10+ occurrences across
dashboard.js, programs.js, stations.js) with direct
`OSApp.Supported.fertigation()` — the outer two checks were always true.
- Fix isFertigation(): remove redundant null-check on controller.fertigation
after OSApp.Supported.fertigation() already guarantees it exists.
- Fix setFertilizerStations(): `data.result === 0` was never returned by
OpenSprinkler; only `result === 1` signals success.
- submitRunonce(): convert fertigation % to seconds before sending
(fd{sid}=seconds), matching the /cr server expectation and the existing
submitProgram21() behaviour.
- firmware.js: remove /pf from the change-command AJAX queue regex since
the /pf endpoint has been removed from the firmware.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Changes Proposed
Demo Video or Screenshots
Please include a short video or screenshot(s) to assist with pr review
output.mp4