Add pressure sensor- #420 - #300
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5b107bc36b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| { id: "sensor3", bit: 11, label: OSApp.Language._( "Sensor 3 Update" ), option: "sn3t" }, | ||
| { id: "sensor4", bit: 12, label: OSApp.Language._( "Sensor 4 Update" ), option: "sn4t" } | ||
| { id: "sensor4", bit: 12, label: OSApp.Language._( "Sensor 4 Update" ), option: "sn4t" }, | ||
| { id: "pressure", bit: 13, label: OSApp.Language._( "Pressure Sensor Update" ) } |
There was a problem hiding this comment.
Split pressure notification into ife2
When a user enables this new bit-13 event, the popup stores a single combined value on #o49. The generic submit path later transforms o49 to ife only, while this same screen reads extended bits from options.ife2; no code writes the upper byte back to ife2. As a result /co receives ife=8192 instead of ife=<low>&ife2=32, so the pressure notification cannot be saved and may cause the settings save to fail on firmware that bounds ife to one byte. Please split high bits into ife2 before submitting.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
It seems that the split is already handled. See options.js line ~254: the case "o49" handler does:
opt.o49 = data & 0xff; // → ife (low byte, bits 0-7)
opt.o65 = (data >> 8) & 0xff; // → ife2 (high byte, bits 8-15)
Bit 13 ends up as bit 5 in o65, which transformKeys() then converts to the firmware key ife2. This is the same mechanism used by sensor3 (bit 11) and sensor4 (bit 12), which are already working.
| if ( OSApp.Firmware.checkOSVersion( 219 ) ) { | ||
| html += "<option value='3'" + ( current === 3 ? " selected" : "" ) + ">" + OSApp.Language._( "Soil" ) + "</option>"; | ||
| } | ||
| html += "<option value='4'" + ( current === 4 ? " selected" : "" ) + ">" + OSApp.Language._( "Pressure" ) + "</option>"; |
There was a problem hiding this comment.
Gate pressure type to supporting firmware
For controllers that expose built-in sensor options but run firmware without the new type-4 handler, this unconditional option now appears in the sensor popup; selecting it sends sn?t=4, but those firmwares only treat known rain/soil types as stop sensors, so the sensor becomes inert while the UI reports it as Pressure. The other non-legacy sensor types in this helper are guarded by version checks; add an equivalent pressure-support gate before exposing this option.
Useful? React with 👍 / 👎.
Changes Proposed
Adding pressure sensor related changes. See OpenSprinkler-Firmware related pull request: OpenSprinkler/OpenSprinkler-Firmware#420
Demo Video or Screenshots