Ejemplo n.º 1
0
        public async Task <string> SendCommand(string device, HeosAction action, List <KeyValuePair <string, string> > parameters)
        {
            var command = GetCommand(action, parameters);

            StreamSocketClient client = new StreamSocketClient();

            return(await client.Connect(device, "1255", command));
        }
Ejemplo n.º 2
0
 private string GetCommand(HeosAction action, List <KeyValuePair <string, string> > parameters)
 {
     return(string.Format("heos://{0}",
                          string.Format(
                              string.Format(Actions[action],
                                            string.Join("&",
                                                        parameters.Select(kvp =>
                                                                          $"{kvp.Key}={kvp.Value}"))))));
 }