diff --git a/src/DataProviders/HarmonyDataProvider.ts b/src/DataProviders/HarmonyDataProvider.ts index 26d017d..48b53c0 100644 --- a/src/DataProviders/HarmonyDataProvider.ts +++ b/src/DataProviders/HarmonyDataProvider.ts @@ -244,17 +244,25 @@ class HarmonyDataProvider { private powerOffDevice = async (device: IDevice) => { let powerOffCommand: string = "Power Off"; + let powerToggleCommand: string = "Power Toggle"; if (device && device.supportsCommand(powerOffCommand)) { await this.sendCommand(device.getCommand(powerOffCommand)); device.on = false; + } else if (device && device.supportsCommand(powerToggleCommand)) { + await this.sendCommand(device.getCommand(powerToggleCommand)); + device.on = false; } } private powerOnDevice = async (device: IDevice) => { let powerOnCommand: string = "Power On"; + let powerToggleCommand: string = "Power Toggle"; if (device && device.supportsCommand(powerOnCommand)) { await this.sendCommand(device.getCommand(powerOnCommand)); device.on = true; + } else if (device && device.supportsCommand(powerToggleCommand)) { + await this.sendCommand(device.getCommand(powerToggleCommand)); + device.on = true; } }