From f0eb57e4dc510e7d95260c0065b342ff3d86bcb5 Mon Sep 17 00:00:00 2001 From: watsonb8 Date: Wed, 24 Jul 2019 16:19:23 -0400 Subject: [PATCH] Commands only send if the activity has already been started. --- src/DataProviders/HarmonyDataProvider.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/DataProviders/HarmonyDataProvider.ts b/src/DataProviders/HarmonyDataProvider.ts index 75b1012..0b34624 100644 --- a/src/DataProviders/HarmonyDataProvider.ts +++ b/src/DataProviders/HarmonyDataProvider.ts @@ -221,6 +221,12 @@ class HarmonyDataProvider { public sendKeyPress = async (controlUnitName: string, key: any) => { if (this.states[controlUnitName]) { let commandName: string = ""; + + //Ignore commands unless the tv is already on + if (!this.states[controlUnitName]!.currentActivity) { + return; + } + let device: IDevice = this.getDeviceFromName(this.states[controlUnitName]!.currentActivity.controlDeviceId); switch (key) { case RemoteKey.ARROW_UP: {