Control of light-based readings

Here’s the way I debug plugins:

  1. Copy the Python code (usually in a __init__.py) to a new file in ~/.pioreactor/plugins/. Example:
    nano .pioreactor/plugins/spec.py
    
  2. So long as the python has click code at the bottom, something like:
    @click.command(name="spectrometer_reading")
    def click_spectrometer_reading() -> None:
        ...
    
    you can run it manually with pio run spectrometer_reading. Python code in the ~/.pioreactor/plugins folder will overwrite any other installed plugins, so you don’t need to worry about existing plugins installed via the UI interferring.
  3. I like to put lots of print or self.logger.debug statements my code during debugging so I can see outputs while running.
  4. When you’re happy, you should remove the plugin (or keep it to continue using it) with rm ~/.pioreactor/plugins/spec.py.