示例#1
0
        public async Task <Result> Love()
        {
            var smartHouseState = await SmartHouseService.GetCurrentState();

            if (smartHouseState == SmartHouseState.Pandora)
            {
                var result = await PlayerService.LoveSong();

                NotifyClients();
                PushNotification(result.Message);

                return(result);
            }
            else if (smartHouseState == SmartHouseState.Music)
            {
                var result = await MpdService.LoveSong();

                NotifyClients();
                PushNotification(result.Message);

                return(result);
            }
            else
            {
                return(new Result()
                {
                    ErrorCode = 0,
                    Message = "You can like only on Pandora or Music input",
                    Ok = true
                });
            }
        }