Commands only send if the activity has already been started.

This commit is contained in:
watsonb8 2019-07-24 16:19:23 -04:00
parent 0ea4188487
commit f0eb57e4dc

View File

@ -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: {