private string GetInputName(IPremiseObject input) { string inputName = input.GetValueAsync <string>("AlexaInputName").GetAwaiter().GetResult(); if (string.IsNullOrEmpty(inputName)) { // if the AlexaInputName isn't set then use the object name. inputName = input.GetNameAsync().GetAwaiter().GetResult(); } return(inputName.ToUpper()); }
public static async Task <DiscoveryEndpoint> GetDiscoveryEndpointAsync(IPremiseObject endpoint) { DiscoveryEndpoint discoveryEndpoint; try { string json = await endpoint.GetValueAsync("discoveryJson").ConfigureAwait(false); discoveryEndpoint = JsonConvert.DeserializeObject <DiscoveryEndpoint>(json, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore }); } catch { discoveryEndpoint = null; } return(discoveryEndpoint); }