ebaauw / homebridge-music

Homebridge plugin for iTunes with AirPlay speakers
Apache License 2.0
93 stars 5 forks source link

Launching Applications on Bridge Restart #24

Closed icepod closed 2 years ago

icepod commented 2 years ago

Hi, I've just recently set up my Homebridge and this Plugin is amazing!

The Plugin is configured for Music>Airfoil on my Mac (OS X 11.6.2), which I also use for other programs in addition to running Homebridge.

The only issue that I have is that everytime I restart my Homebridge, this plugin automatically checks for and starts the 'Music' and 'Airfoil' programs on the Mac. It can be very annoying because it takes the focus away from another application I might be using. Also, if am not listening to music, I like to save resources by having Music+Airfoil+Airfoil Satellite be closed.

I have an AppSwitch plugin to manually start Applications on my Mac if I, for example, want to listen to music. Therefore, this plugin starting those apps is not necessary.

I don't really understand Scripts, so I have been unable to modify the files here to stop the automatic start from happening.

Could anyone one help me?

Thanks in advance!

ebaauw commented 2 years ago

I have an AppSwitch plugin to manually start Applications on my Mac if I, for example, want to listen to music.

The idea behind Homebridge Music is that you use HomeKit when you want to listen to Music, so you can integrate that into your home automation (e.g. turn on the music when entering the room). For that you want Homebridge Music to be running all the time. If you use AppSwitch when you want to listen to music, then why use Homebridge Music at all?

everytime I restart my Homebridge, this plugin automatically checks for and starts the 'Music' and 'Airfoil' programs on the Mac.

Homebridge Music needs to connect to Music and Airfoil on startup, to get the current status and available speakers. The integration through AppleScript opens these applications, before being able to interact with them. Afaik, there’s no way around that. You can exit Music once Homebridge Music has started (and the player isn’t active), but it will re-open when you turn the player back on. I’ve never tried exiting AirFoil; it happily sits in the menu bar without bothering me.