Volume rocker working

This commit is contained in:
watsonb8
2019-06-16 21:36:12 -04:00
parent e49af64a18
commit 8c3a02fa85
2 changed files with 21 additions and 3 deletions

View File

@ -170,11 +170,23 @@ class HarmonyDataProvider {
}
public volumeUp = async (controlUnitName: string) => {
let volumeUpCommand: string = "Volume Up"
if (this.states[controlUnitName]) {
let volumeDevice: IDevice = this.getDeviceFromName(this.states[controlUnitName]!.currentActivity.volumeDeviceId);
if (volumeDevice.supportsCommand(volumeUpCommand)) {
this.sendCommand(volumeDevice.getCommand(volumeUpCommand));
}
}
}
public volumeDown = async (controlUnitName: string) => {
let volumeDownCommand: string = "Volume Down"
if (this.states[controlUnitName]) {
let volumeDevice: IDevice = this.getDeviceFromName(this.states[controlUnitName]!.currentActivity.volumeDeviceId);
if (volumeDevice.supportsCommand(volumeDownCommand)) {
this.sendCommand(volumeDevice.getCommand(volumeDownCommand));
}
}
}
public sendKeyPress = async (controlUnitName: string) => {