Binner Bin API support (highlight/locate parts API)#439
Open
itzandroidtab wants to merge 7 commits intoreplaysMike:masterfrom
Open
Binner Bin API support (highlight/locate parts API)#439itzandroidtab wants to merge 7 commits intoreplaysMike:masterfrom
itzandroidtab wants to merge 7 commits intoreplaysMike:masterfrom
Conversation
Contributor
Author
|
I made a small demo using some ws2801 and a lpc1788 dev board. In the video you can see the lights turn on when opening the "locate" popup. And you can see after closing the popup the light stays on for 15 more seconds before turning off. (each light is assigned a bin number 0 -> first led, 1 -> second led, etc) Most of the colors appear oversaturated because there's no diffuser. api_example.mp4The LPC1788 was polling the API once every second in the video |
Contributor
Author
|
I now made it so if you press "close" it will stop it straight away |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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