streamdeck-api-request icon indicating copy to clipboard operation
streamdeck-api-request copied to clipboard

Feature/display data from response

Open Commit-La-Grenouille opened this issue 3 years ago • 12 comments

Hi,

as discussed in issue #3, here is a possible implementation of the display of data from the response on the button (latest stable on the right and this PR's code with the same API call on the left): AFTER-and-BEFORE

This implementation uses the setTitle() to display the data on the button. The good: the user can leverage the title config (color, location, font size...) from the config to control the look of the text. The bad: you cannot use the Title field (otherwise it will hide the data from setTitle()) and must use the name field instead.

I will give a look at an alternative implementation where the data from the response is rendered as bitmap instead (but not quite sure how good it will look and it will come with its limitations on text style if we want to keep the config reasonably compact).

Commit-La-Grenouille avatar Apr 24 '22 16:04 Commit-La-Grenouille

Just realized while coming back to the PR today to properly add the unit in the config (as the screenshot code was hardcoded) that it is missing the polling capability. I fixed it by adding the proper PI elements & supporting code. To simplify the review (and any potential split), I kept the polling code in a separate commit :)

Commit-La-Grenouille avatar Apr 25 '22 11:04 Commit-La-Grenouille

Note for myself: I noticed this morning after a fresh boot that the refresh timeout seems not-to-be honored as I had the warning sign about every 15s (as the DNS was not resolving yet) despite the fact my buttons were configured to refresh every 300 or 600s. To be investigated what in this PR (or not) introduce this regression...

Commit-La-Grenouille avatar May 12 '22 05:05 Commit-La-Grenouille

Hi @mjbnz,

sorry for the delayed update. I finally found some time to track the polling bug I mentioned earlier. The good news was that I missed one line to plugin the polling into to frequency calculation 😀 Let me know what you think of the diff and if you want me to do some changes to the code and/or commits prior to merging it :)

Commit-La-Grenouille avatar Jul 17 '22 14:07 Commit-La-Grenouille

+1 to this feature. It would be great to see the functionality added.

benbalter avatar Aug 04 '22 20:08 benbalter

will this feature merged?

killriam avatar Feb 19 '23 19:02 killriam

Hi @killriam, technically, you can take the content of the folder and deploy it flat into your stream deck plugin folder as a plugin. If you still want to try the version from this PR, I have created a packaged version equivalent to simplify the drag-and-drop: https://github.com/Commit-La-Grenouille/streamdeck-api-request/releases

I have been using it daily at work on 5 buttons and cannot get enough of it ;) (many thanks to @mjbnz for developing this very useful plugin !)

Commit-La-Grenouille avatar Mar 14 '23 10:03 Commit-La-Grenouille

i tried out this pull request as a plugin, but still i am not able to find the json path i think... how can it look if it is: {"channel":"12345","username":"doabigcheese","points":100,"pointsAlltime":300,"watchtime"400,"rank":1189} I try to get the "points" from streamelements.com for a twitch channel... so there is not [ ] brackets in the response

doabigcheese avatar May 23 '23 12:05 doabigcheese

Looking forward to see this merged!

titogarrido avatar Jul 10 '23 15:07 titogarrido

Hi @killriam, technically, you can take the content of the folder and deploy it flat into your stream deck plugin folder as a plugin. If you still want to try the version from this PR, I have created a packaged version equivalent to simplify the drag-and-drop: https://github.com/Commit-La-Grenouille/streamdeck-api-request/releases

I have been using it daily at work on 5 buttons and cannot get enough of it ;) (many thanks to @mjbnz for developing this very useful plugin !)

I did not find the release you mentioned here. Is it still available?

Thanks!

titogarrido avatar Jul 10 '23 18:07 titogarrido

I did not find the release you mentioned here. Is it still available?

FYI, you can just download the source ZIP file from https://github.com/Commit-La-Grenouille/streamdeck-api-request and copy the contents within the Source folder into the "com.github.mjbnz.sd-api-request.sdPlugin" folder you already have (yes to overwrite). Restart the streamdeck app. You'll probably have to recreate any buttons using it though.

That's all the "release" really is.

Note it won't work unless you set a background image. And getting a different value to show from a different URL than what the button does is broken. (Which is changeable if you feel like editing.) At some point I might work on a text-only fork, as this does exactly what I need, with a secondary polling URL, but I only care about text from the response and want to use library images.

wiretail avatar Nov 11 '23 01:11 wiretail

Thanks @rgreer4 for sharing the deployment trick.

As for the limitation, I would be interested by a simple reproducer using a public service to look into it and adjust this PR accordingly (the more useful the PR the better) ;)

Commit-La-Grenouille avatar Nov 21 '23 13:11 Commit-La-Grenouille

I am trying to install it on 6.5 but I am not able to... I couldn't even find the "com.github.mjbnz.sd-api-request.sdPlugin" folder so I can replace with @Commit-La-Grenouille code... is there a way to provide the sdPlugin package? Seems that @mjbnz is not maitaining it anymore...

titogarrido avatar Feb 14 '24 19:02 titogarrido