public async Task <Result> Right() { var sb = new StringBuilder(); var powerStatus = await YamahaService.PowerStatus(); if (powerStatus == PowerStatusEnum.On) { var mpdState = MpdService.GetStatus().State; var smartHouseState = await SmartHouseService.GetCurrentState(); if (smartHouseState == SmartHouseState.Music && (mpdState == MpdState.Play || mpdState == MpdState.Pause)) { MpdService.Next(); sb.AppendLine("MPD Next song"); } else if (smartHouseState == SmartHouseState.Pandora) { PandoraService.Next(); sb.AppendLine("Pandora next song"); } else if (smartHouseState == SmartHouseState.TV) { await TVService.Right(); sb.AppendLine("TV forward"); } } else { sb.AppendLine("Yamaha is turned off. Operation canceled"); PushNotification("Yamaha is turned off. Operation canceled"); } return(new Result() { ErrorCode = 0, Message = sb.ToString(), Ok = true }); }
public Result Next() { return(MpdService.Next()); }