bitfocus / companion-module-generic-http

Generic HTTP module
MIT License
9 stars 19 forks source link

json result data to custom var #28

Closed ghost closed 2 years ago

ghost commented 2 years ago

fixes #24, re #27

For more information please refer to #27

Testing

# within companion source folder

cd module-custom-dev
git clone https://github.com/abebeos/companion-module-generic-http.git
cd companion-module-generic-http
git checkout feat/i24-json-result-to-var
cd ..

yarn dev

Following screenshots show the get-request and the setvar on 2 buttons (this can be done with 1 button, too, adding 2 actions and possibly some delay)

(Post-Merge update re the instructions below: The setvar action was moved to the 'internal' module, see https://github.com/bitfocus/companion-module-bitfocus-companion/pull/50)

image

image

image

image

image

image

Julusian commented 2 years ago

@JeffreyDavidsz before you pull it into companion, ill move the setvar action to the other repo

JeffreyDavidsz commented 2 years ago

just in time ;-)

JeffreyDavidsz commented 2 years ago

@Julusian I asumed you pull in the PR on the bitfocus-companion module?

Julusian commented 2 years ago

all merged into the builds now

kjetilpp commented 2 years ago

Will i get this update if running git pull in /usr/local/src/companion, or do i need to do something else? 😄

Julusian commented 2 years ago

@kjetilpp that depends on which version of companionpi you wrote to the sd card

It is possible that a sudo companion-update (which should be used rather than directly doing a git pull) will update to a version including this, but if your companionpi image is too old, it could be locked to either the 2.1 stable releases, or to the 2.2 stable releases.

kjetilpp commented 2 years ago

@Julusian thanks. Are running [2.2.0 (2.2.0+3998-ccea40c7)]

Julusian commented 2 years ago

Then it looks unlikely

You should be able to do a sudo git checkout beta in /usr/local/src/companion followed by sudo companion-update to do it.

Or wait a week for 2.2.1 to be released, as it will be included in that

AJolly commented 4 months ago

Trying to use this with my companion install (3.2.2) HTTP Requests v2.1.6. I'm only seeing :

POST
GET
PUT
PATCH
DELETE

No HTTP SetVar or other way to parse JSOn.
And I'm not seeing documentation for this module, or where to go for more info. Any advice? Am new to companion, coming from streamdeck.