Binner Bin API support (highlight/locate parts API) #439
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds support for highlighting/locating of parts using a external device. I tried keeping the API as simple as possible to make sure it is doable on a microcontroller. The API works as follows:
API External Device
External device polls endpoint
api/highlightusing POST with API key in the Query (e.g. https://some-ip:8090/api/highlight?apiKey=someApiKey).When a part needs to be highlighted a JSON response will be send with the Bins that should to light up.
API Binner Side
In the background Binner will update a Dictonary with the new location to highlight. When the external device polls the API endpoint it will now add this location to the response.
While this popup is shown the Web UI will keep sending keep alives (every 2.5 seconds) to the endpoint to make sure the highlight stays active.
To cleanup the any highlights that are active there is a background process that checks every 5 seconds if there is any highlights that need to be removed (15 second timeout before removing the highlight).
Notes