Add basic The Handy APIv3 / FW4 support #217
Draft
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.
Added a new output device, an alternative to the The Handy output device but for devices that have been updated to firmware version 4 or above, using the new API v3.
Some problems:
This is a quick and dirty job, I copied code from another app of mine and quickly ported it, so the code is not clean, my style probably does not fit the rest of the application, and there's probably some unused code remnants/references. However, it does work. I did the change mostly just for myself, but I figured I'd open the PR in case you want to take it into consideration despite its flaws.
The new API needs to send points in advance to build up a buffer on the server. As far as I could tell this doesn't mesh with the structure of this software that sends the points in real-time to the output device class. In addition, I find that the new API needs to have points continuously sent to it to not have the buffer underrun, even if the position hasn't changed. So I implemented my own buffer and interpolation and I send points to the API in a separate threaded timer. This creates a delay of around 1s, so the user has to manually change the axis "offset" settings to compensate for the delay, for example to -1.0s, and fine tune until it matches the script. This isn't user friendly. There's probably a better way to do this, to automate the latency, but I didn't study the software enough to know.
The tab header isn't big enough to show the whole name of the device. I titled my view "The Handy FW4" but in the UI it shows up as "he Handy FW"
The new API needs an application ID, a sort of public auth key to identify what app is connecting to the API. I created an ID in my account but if you implement this device then you probably want to create your own key so that you can maintain it. Can be done at https://user.handyfeeling.com/