Closed gordonbrander closed 8 years ago
The latest
view in environmental_data_point
could be used to do this. When a recipe is started, it creates a data point of type RECIPE_START saying which recipe was started. The RecipeHandler module does this here to check if a recipe is already running when it is initialized.
Thanks!
To construct the query, I need to know the environment ID:
/environmental_data_point/_design/openag/_view/latest?key=[ENVIRONMENT_ID, "EnvironmentalVariable.RECIPE_START", "measured"]
Do we plan to have a design document for this in the environment
database?
No, you would just query the environment
database to see what environments there are and send the ID of the one in which you want the start the recipe. In the food computers, there will probably only ever be 1 environment though.
We'll need an API endpoint that allows us to query ID of currently running recipe on Raspberry Pi. I don't see a design document for this endpoint in https://github.com/OpenAgInitiative/openag-brain/tree/master/openag/brain/core/_design. Am I missing something?