Check if the TV is on before turning it on/off

The iOS TV Remote volume control sets the Active characteristic when changing the volume which sends a MENU keypress to the Apple TV even if the TV is already on.
parent 98bd5e27
......@@ -160,8 +160,6 @@ iOS 12.2 Television service
You can enable the Television service (supported in the Home app on iOS 12.2 and later) by setting the
`expose_television_service` flag.
I haven't updated to the iOS 12.2 beta so I haven't tested this properly.
"accessory": "vestel-network-remote.TV",
......@@ -448,7 +448,10 @@ class TVAccessory {
setPowerState(on) {
async setPowerState(on) {
const on_now = await this.getPowerState();
if (on_now === on) return;
return this['setPowerStateO' + (on ? 'n' : 'ff')]();
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment