Add configurable manual feed amount, global feed settings, and feed history fixes - #27
Conversation
|
Sorry new feature and bugfix in one PR. |
|
I think the new feed history ordering still has an off-by-
uint8_t ringIndex = (writeIndex + historyCount - 1 - i) % MAX_FEED_HISTORY;would read The base should be the slot before uint8_t ringIndex = (writeIndex + MAX_FEED_HISTORY - 1 - i) % MAX_FEED_HISTORY;That yields |
|
Good catch, you were right.
I updated the calculation to:
This fixes partially filled buffers and still works after wrap-around and after reboot with the persisted write index.
|
|
Thanks, this looks close. I found two follow-ups before merge:
|
|
Sorry for that! I fixed I also tightened the mock validation so
|
Summary
Feed Nowand hardware button manual feeding1..5to1..10Details
This PR introduces a new
manual_portion_unitsconfig value that is stored on the device and shared by both manual feed entry points:Feed Nowin the web UIThe UI now has a separate
Feed settingsblock above the schedules section. Global feed settings are no longer shown inside the schedules area.Portion size (g per unit)remains a global setting and now sits alongside the new manual feed amount control.Portion unit validation has been expanded consistently from
1..5to1..10across firmware, frontend, and mock API.Feed history fixes
This PR also fixes feed history retrieval and persistence:
/api/status/historyis now routed correctly/api/statushandlerAdditionally,
FeedingService::feed()is now aligned with the current1..10portion range.Validation
make buildsuccessfullyIncluded updates
manual_portion_units