public static HdmiCommand SetName(this HdmiCommand command, HdmiSource hdmiSource, string name) { if (command == null) { throw new ArgumentNullException(nameof(command)); } switch (hdmiSource) { case HdmiSource.Input1: command.Input1 = EnsureExists(command.Input1); command.Input1.Name = name; break; case HdmiSource.Input2: command.Input2 = EnsureExists(command.Input2); command.Input2.Name = name; break; case HdmiSource.Input3: command.Input3 = EnsureExists(command.Input3); command.Input3.Name = name; break; case HdmiSource.Input4: command.Input4 = EnsureExists(command.Input4); command.Input4.Name = name; break; } return(command); }
public async Task ApplyHdmiCommandAsync(HdmiCommand command) { if (command == null) { throw new ArgumentNullException(nameof(command)); } CheckInitialized(); var client = await GetHttpClient().ConfigureAwait(false); var response = await client.PutAsync(new Uri($"{_apiBase}/api/v1/hdmi"), SerializeRequest(command)).ConfigureAwait(false); await HandleResponseAsync(response); }