For TV remote: add power on/off and mute functionality
Opened this issue · 3 comments
From the documentation, the only functionalities supported for the TV "remote" (accessible via the iphone/ipad remote app) are:
rewind, fastForward, nextTrack, previousTrack, arrowUp, arrowDown, arrowLeft, arrowRight, select, back, exit, playPause and info
However the GUI seems to support a power button and a mute button on that screen. Simply adding those fields to the "remote" portion of the JSON doesn't do the trick. Is the fix as simple as adding a few more lines to accessories\tv.js
, specifically lines 246 onwards?
let hexData = null;
switch (newValue) {
case Characteristic.RemoteKey.REWIND:
hexData = data.remote.rewind; // not found yet
break;
case Characteristic.RemoteKey.FAST_FORWARD:
hexData = data.remote.fastForward; // not found yet
break;
case Characteristic.RemoteKey.NEXT_TRACK:
hexData = data.remote.nextTrack; // not found yet
break;
case Characteristic.RemoteKey.PREVIOUS_TRACK:
hexData = data.remote.previousTrack; // not found yet
break;
case Characteristic.RemoteKey.ARROW_UP:
hexData = data.remote.arrowUp;
break;
case Characteristic.RemoteKey.ARROW_DOWN:
hexData = data.remote.arrowDown;
break;
case Characteristic.RemoteKey.ARROW_LEFT:
hexData = data.remote.arrowLeft;
break;
case Characteristic.RemoteKey.ARROW_RIGHT:
hexData = data.remote.arrowRight;
break;
case Characteristic.RemoteKey.SELECT:
hexData = data.remote.select;
break;
case Characteristic.RemoteKey.BACK:
hexData = data.remote.back;
break;
case Characteristic.RemoteKey.EXIT:
hexData = data.remote.exit;
break;
case Characteristic.RemoteKey.PLAY_PAUSE:
hexData = data.remote.playPause;
break;
case Characteristic.RemoteKey.INFORMATION:
hexData = data.remote.info;
break;
}
Something like case Characteristic.RemoteKey.MUTE: hexData = data.remote.mute; break;
or some such? (And equivalent for power?)
Also: the code above seems to indicate (correctly) that the remote program doesn't do anything with FF/RW/Next/Prev. I also don't see it doing anything with Exit at the moment.
I've been searching for how to implement this as well and would appreciate the added functionality. I believe the buttons are new additions with iOS 17 and should be easily implemented in the same fashion as the others like you described...
Any update on this? Simple to implement.