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

[Issue] Changing picture based on Expected Value String doesnt work.

Open AquaCobell opened this issue 2 years ago • 4 comments

My get request looks like this image

image image

Am I doing something wrong or is this a bug?

AquaCobell avatar Dec 04 '23 19:12 AquaCobell

I have the same issue. Image isn't changing at all. In addition, I have no idea how the Periodically poll a URL for status works. Do I have to copy just the initial URL again? Does it uses the same headers? Should it apply the same image change for matching / unmatching results?

dannyyy avatar Dec 17 '23 11:12 dannyyy

I was able to figure out a solution via debugging - setting the registry value mentioned there and debugging via Chrome helped further.

The below config parses a json value returned from Portainer REST api, endpoint "portainer/api/endpoints/2/docker/containers/json". The returned json is a list, so I need a list index first and then access the json field "State". List index works without brackets or root element here, just give the index number. However, I couldn't get it working without entering a json path.

The button config above the section "periodically poll..." is basically used when you press the streamdeck button manually, while the polling section is used for the automated refresh. If you want to have the same action done manually and periodically, you need to give the request url twice (json path and expected value if different). Apparently the request headers are used for both manual and periodic requests. It seems you can send different requests for manual and periodic execution, but the button state is evaluated from both results. So either set json path and expected value for manual action to values matching the manual action json result, otherwise it seems that it is also valid to set json path to * and keep expected value empty to have the result matching always.

Hope this helps.

grafik

m-10-c avatar Jan 13 '24 11:01 m-10-c

@m-10-c I had to read it three times before I understood your reply, but now it finally works. Thank you soo much :)

AquaCobell avatar Jan 22 '24 17:01 AquaCobell

either I'm missing something or it doesn't work again. grafik grafik

AquaCobell avatar Mar 30 '24 18:03 AquaCobell