Autoconnect to first running Kodi instance


#1

I got 2 Kodi instances running. Both are connected to a smart outlet.
If I am sitting on my couch the kodi instance in my livingroom is running and the instance in my Bedroom is Off.
Yatse should probe connect to each instance and stay on the first instance it is able to connect to.


#2

No it should not as it would just kill your battery for little to no purpose than avoiding 1 click :slight_smile:

If you have different Wifi AP you can use Tasker to auto switch the Kodi instance for example.
If you really want to ping device non stop to switch then Tasker can do that too, but I strongly discourage you from doing that.

(Tasker or other similar apps)


#3

Thanks for the fast reply =)

I don’t mean to check for this all the time.
I mean to just check on start of the first intent.

I mean: you already check if the Kodi instances registered in Yatse are running.
Is it that battery draining when the app checks if the app is connected to a running Kodi instance?

I mean something like this when Yatse is firstly started :

List<KodiInstance> allKodiInstances = getAllKodiInstances();
KodiInstance lastConnectedKodiInstance = getLastConnectedKodiInstance();

if(!lastConnectedKodiInstance.isOnline())
{
    for(KodiInstance kodi : allKodiInstances)
    {
        if(kodiInstance.isOnline())
        {
            kodiInstance.connect();
            break;
        }
    }
    
}

#4

You just forget that we are in android world, there’s no such thing as firstly started.

Firstly started or bring back from tasks or switching activity is more of less the same :wink:

You also forget that Yatse can be fully operated via widgets, notifications, Wear, API, … all those have also no concept of first start.

So no your solution is not possible and does not fit, not talking about the guy who have 8 devices, timeout to ping at 2 sec means 16 seconds waiting each time he launch the app when clicking the host takes less than 1?

The API allows you to easily do that if you really want. You can create a task in Tasker that ping all hosts, select the one up then start Yatse from a launcher icon if that’s what you really want. Anything else is out of Yatse scope and the API is here so you can do whatever needs you have.