Closed chatziko closed 3 months ago
+1 for this pls. I just found this because I assumed it would already work and was searching for how to do it. Came across this instead, so I'm guessing it's not already possible.
I decided to attack this again recently and after much confused bumbling around trying to make this Home Assistant service work:
service: notify.mobile_app_muir
data:
message: command_activity
data:
intent_package_name: de.badaix.snapcast
intent_class_name: .SnapclientService
intent_action: ACTION_START
intent_extras: EXTRA_HOST:harvest:String,EXTRA_PORT:1704:int
Despite this adb command working fine:
am start-service -f 0x10000000 --es EXTRA_HOST 'harvest' --ei EXTRA_PORT 1704 -a ACTION_START -p de.badaix.snapcast de.badaix.snapcast/.SnapclientService
I gave up and went for rebasing & compiling this pull request on the latest version of the app, confirmed it works well. Now when the device eventually OOM kills snapcast while it's muted and not doing anything, it'll start back up again when I actually want to unmute it anyway.
I believe this would be a very useful feature to include in the main upstream repo. Even without Home Assistant, this allows things like Tasker and many other automation tools to work with Snapdroid better while worrying less about Android's RAM management clearing up the process if it's muted for long periods of time.
I rebased the PR to make it easier to merge. Personally I've been using it for some time now and it words great.
@badaix : please consider merging, it's a relatively simple change with many potential users (several have already expressed interest here).
Thanks! Will merge when I'm back from vacation.
I see this one's still unmerged. Got any updates for us?
I would like this specific feature on my GoogleTV, but am a little stuck with apps available via the Play Store there.
Maybe the upcoming v0.28 is a good opportunity to push this PR forward?
This small PR allows the android snapcast client to be controlled (stop / start) by another app (or adb) via broadcast intents (
de.badaix.snapcast.START_SERVICE / STOP_SERVICE
).For instance, one could stop the snapcast client via a Home Assistant notitification:
or start the client from any remote script via adb:
I think it's a pretty useful feature to have, since many people use snapcast together with automation routines.
PS. To be able to use
START_SERVICE
when the app is in the background, one needs to selectAllow background activity
in the app'sbattery usage
options.