homebridge-cmdswitch2 icon indicating copy to clipboard operation
homebridge-cmdswitch2 copied to clipboard

Feature request: Display arbitrary info

Open RobotLimeLtd opened this issue 6 years ago • 1 comments

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'"
},

RobotLimeLtd avatar Jun 10 '18 09:06 RobotLimeLtd

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.

randyinla avatar Jun 10 '20 07:06 randyinla