async public override Task <SkillResponse> HandleIntentRequest(IntentRequest request) { var log = curContext.Logger; slots = request.Intent.Slots; Slot lightStateSlot = null; if (slots.ContainsKey(LIGHTCONTROl)) { lightStateSlot = slots[LIGHTCONTROl]; } // Need to seperate it out. Wash_Lights washLtsMsg = new Wash_Lights { DeviceType = "200", Instance = 1, LightState = lightStateSlot.Value }; LightsAlexaMsg msg = new LightsAlexaMsg { ID = 2000, IntentName = request.Intent.Name, Slot = washLtsMsg }; await DynamoDB.PutAlexaMsg(msg); outSpeech = new PlainTextOutputSpeech(); //(outSpeech as PlainTextOutputSpeech).Text = "Alright!. I have sent a message to venue system to push " + monVidSrcSlot.Value + " on " + monLocSlot.Value + " Monitor."; (outSpeech as PlainTextOutputSpeech).Text = "Cabin system accepted your request. Enjoy your flight!. "; skillResponse.Response.OutputSpeech = outSpeech; skillResponse.Response.ShouldEndSession = true; return(skillResponse); }
public object FromEntry(DynamoDBEntry entry) { Primitive primitive = entry as Primitive; if (primitive == null || !(primitive.Value is String) || string.IsNullOrEmpty((string)primitive.Value)) { throw new ArgumentOutOfRangeException(); } string[] data = ((string)(primitive.Value)).Split(new string[] { " x " }, StringSplitOptions.None); if (data.Length != 3) { throw new ArgumentOutOfRangeException(); } Wash_Lights complexData = new Wash_Lights { DeviceType = data[0], Instance = Convert.ToInt32(data[1]), LightState = data[2] }; return(complexData); }