Commands only send if the activity has already been started.
This commit is contained in:
parent
0ea4188487
commit
f0eb57e4dc
@ -221,6 +221,12 @@ class HarmonyDataProvider {
|
|||||||
public sendKeyPress = async (controlUnitName: string, key: any) => {
|
public sendKeyPress = async (controlUnitName: string, key: any) => {
|
||||||
if (this.states[controlUnitName]) {
|
if (this.states[controlUnitName]) {
|
||||||
let commandName: string = "";
|
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);
|
let device: IDevice = this.getDeviceFromName(this.states[controlUnitName]!.currentActivity.controlDeviceId);
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case RemoteKey.ARROW_UP: {
|
case RemoteKey.ARROW_UP: {
|
||||||
|
Loading…
Reference in New Issue
Block a user