benknight / hue-alfred-workflow

An Alfred workflow for controlling Philips Hue lights.
367 stars 34 forks source link

Combining commands with `|` doesn't work? #51

Closed varenc closed 3 years ago

varenc commented 4 years ago

I couldn't get multiple commands combined with | to work. The last command in the combo is the only things that runs. It didn't look like the python code that appears to split on | was involved.

My hacky solution to this was to change the bash script that processes external triggers to this:

for i in $(echo "{query}" | tr "|" " "); do 
    echo "Running this Hue command: $i"; 
    /usr/bin/python -m logic.action "$i";
done;

And it works okay! Would be far more efficient to do the splitting on the python side (and submit a PR), but this got things working for me in a couple mins. I might have just been doing it wrong.

benknight commented 3 years ago

@varenc sorry for the long delay.

I no longer own a Hue system (crazy I know) so I can't confirm your bug report. If you can reliably reproduce this issue and are confident that command splitting is indeed broken, please submit a pull request so that I can cut a new version.

scholzie commented 3 years ago

@benknight I took the liberty of fixing it since I ran into this problem today.