Farmbot-Web-App icon indicating copy to clipboard operation
Farmbot-Web-App copied to clipboard

RESET HARDWARE PARAMETER DEFAULTS should be based on FarmBot model

Open roryaronson opened this issue 6 years ago • 2 comments

Depending on the FarmBot model chosen, the RESET HARDWARE PARAMETER DEFAULTS button should reset defaults to appropriate values for that model. Maybe use the seeding feature under the hood?

If no model or "Custom bot" was chosen, reset to app defaults.

roryaronson avatar Jul 23 '19 23:07 roryaronson

Combined with #1328

roryaronson avatar Sep 18 '19 21:09 roryaronson

Split from #1328 since this is a "reset" rather than an "add" behavior.

Resetting hardware parameters calls this RPC: https://github.com/FarmBot/farmbot-js/blob/a102ace924978054e5c7f42411f3891852e532d0/src/farmbot.ts#L150-L155

Which results in the following actions from FarmBot OS: https://github.com/FarmBot/farmbot_os/blob/7a6c544e21abb6f8d70c7acc9a59c2f0f8c11bb4/farmbot_os/lib/farmbot_os/sys_calls/factory_reset.ex#L18-L30

And calls FirmwareConfig destroy: https://github.com/FarmBot/Farmbot-Web-App/blob/ee8851b0af677d81bd6d3131a42fba6f64ebcf66/app/controllers/api/abstract_config_controller.rb#L20-L23

After the config is destroyed, the defaults used will need to change based on model. Currently the only difference between versions is disabling stall detection by default for Express models, but that could change.

Full default FirmwareConfig: https://github.com/FarmBot/Farmbot-Web-App/blob/66962e1bdb6fd72376446671dd2ab7acb1708ac2/db/structure.sql#L495-L602

gabrielburnworth avatar Feb 22 '20 15:02 gabrielburnworth