Add ability to provide sensor command routines
Summary
Add the ability to provide routines of sensor commands to run once or periodically. A routine can provided via a JSON file to the CLI via the new --routine-file
option in the start
command.
Contents (#12)
IMPORTANT: There is 1 breaking change.
New features
- Allow user to provide a routine of sensor commands to the CLI via a JSON routine file
Enhancements
- BREAKING CHANGE: Separate interactive mode from whether data is saved locally or to the cloud
- Add CLI option to save data locally
- Add CLI option to not upload data to the cloud (i.e. uploading to the cloud is the default)
- Add
Routine
class for scheduling commands once or periodically - Warn if serial port buffer size cannot be set due to not being on Windows
Fixes
- Ensure commands file is always written to disk locally
Refactoring
- Always run the packet reader in a separate thread so that commands can be sent to the serial port either in interactive mode or by a routine
- Factor out logic in CLI
start
command into functions - Remove unused
--stop-when-no-more-data
option from CLI
Testing
- Use
--use-dummy-serial-port
CLI option instead of mocking serial port in CLI tests
Quality Checklist
- New features are fully tested (No matter how much Coverage Karma you have)
- [v0.2 onward] New features are included in the documentation