homebridge-cmdswitch2
homebridge-cmdswitch2 copied to clipboard
Feature request: Display arbitrary info
It would be great if we could display something other that just "Powered On" or "Powered Off" when 3D-pressing the switch, using a shell command. For example, when controlling a PS4, it could show the currently running game, e.g.
{
"name": "PS4 Pro",
"manufacturer": "Sony Corporation",
"on_cmd": "ps4-waker",
"off_cmd": "ps4-waker standby",
"state_cmd": "ps4-waker search | grep -i '200 Ok'"
"info_cmd": "ps4-waker search | grep 'running-app-name' | cut -d':' -f2 | sed -e 's/\"//g;s/,//g'"
},
Given the plugin only checks for the state of something being true or not via the state_cmd, you could create a separate switch for each game you play, then grep the app name so it appears as "on" (running) or not. Not the best solution, but is "a" solution for now.