hyperion-project / hyperion.control

Kodi Addon to control Hyperion.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Separate Instance Handling

clutwo opened this issue · comments

Thank you for this addon, I have used it a long time and it almost always worked flawlessly. I have now setup another LED instance in Hyperion, and unfortunately, it only works for the first instance.

When having multiple LED instances set up in Hyperion (one Arduino and one WLED in my case), only the first one gets updated according to hyperion-control settings.

According to API documentation, only one instance can be controlled with a connection (defaults to instance 0). To switch to another instance, the following command has to be sent:

// Switch to instance 1 { "command" : "instance", "subcommand" : "switchTo", "instance" : 1 }

This switches the context to instance 1 which can then be controlled normally.

This addon should work with an arbitrary amount of instances. For my case, it would be enough to apply the same settings for all instances for now, but maybe applying different settings (configured in the Control GUI) to different instances should also be considered.

I have implemented a simple applying of settings to all running LED instances in ec66986

On init, Connection retrieves server info and stores it. When sendComponentState is called, it checks for running instances, switches to each, and applies the settings.

@clutwo awesome! thank you so much for this! this is exactly what I needed!

@Lord-Grey can we add this to the next addon update, od does the @clutwo need to prepare a PR?