I have Hyperion up & running on a windows machine.
I am attempting to control multiple instances using python requests as follows
[INDENT]command1 = post("http://10.0.1.3:8090/json-rpc", data = '{"command" : "instance","subcommand" : "switchTo","instance" : 1}')
command2 = post("http://10.0.1.3:8090/json-rpc", data = '{"command":"componentstate","componentstate":{"component":"LEDDEVICE","state":true}}')[/INDENT]
This generates the following logs:
[INDENT] 2020-10-04T23:35:15.114Z [hyperiond HTTPJSONRPC] (DEBUG) (JsonAPI.cpp:81:JsonAPI::handleInstanceSwitch()) Client '::ffff:10.0.1.4' switch to Hyperion instance 0
2020-10-04T23:35:15.115Z [hyperiond HTTPJSONRPC] (DEBUG) (JsonAPI.cpp:81:JsonAPI::handleInstanceSwitch()) Client '::ffff:10.0.1.4' switch to Hyperion instance 1
2020-10-04T23:35:15.129Z [hyperiond HTTPJSONRPC] (DEBUG) (JsonAPI.cpp:81:JsonAPI::handleInstanceSwitch()) Client '::ffff:10.0.1.4' switch to Hyperion instance 0
[/INDENT]
As I understood it, switching instance would make the subsequent commands apply to that instance. But obviously each request I am sending counts as a new connection and switches to instance 0 again.
Can anyone enlighten me as to how I might send both commands in one connection? Is this possible using requests, or any other methods?
For the moment my workaround is to use the startInstance/stopInstance subcommands from the docs, but I would rather leave the instances running and just disable the LED Devices to avoid the startup delay.
Would appreciate any help or advice! Thanks.