I'm working on a script to toggle hyperion on/off from kodi, and have had success following the guide outlined here:
http://blog.nadnerb.co.uk/?p=11
But the problem is if you use this script while hyperion is actively running, whatever lights where being displayed before the script was ran will remain on. My question is if there is a command I can issue to the hyperion remote script to stop the grabber and clear the LED data before killing the hyperiond process.
Here is the code I'm working with (pi2 running libreelec):
Bash
#!/bin/bash
SERVICE='hyperiond'
if ps | grep -v grep | grep $SERVICE > /dev/null
then
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Hyperion","message":"Disabled","image":"/home/pi/hyperion.png"}}'
http://xbmc:xbmc@127.0.0.1:8080/jsonrpc
killall hyperiond
else
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"Hyperion","message":"Enabled","image":"/home/pi/hyperion.png"}}'
http://xbmc:xbmc@127.0.0.1:8080/jsonrpc
/storage/hyperion/bin/hyperiond.sh /storage/.config/hyperion.config.json > /storage/logfiles/hyperion.log 2>&1 &
fi
Alles anzeigen
Any help would be appreciated - it seems like this should be simple to figure out, but I was having a hard time!