Example #1
0
 private async Task Update(string payload)
 {
     Logger.Debug(() => $"{nameof(ChromaSink)} received payload: {payload}. Applying to {string.Join(", ", SupportedDevices)}");
     try
     {
         JObject.Parse(payload);
         await Task.WhenAll(SupportedDevices.Select((device) => Client.UpdateAsync(device, payload)));
     }
     catch (JsonReaderException e)
     {
         Logger.Debug(() => $"{nameof(ChromaSink)} received invalid json: {payload} ({e.Message})");
     }
 }
Example #2
0
 private async Task ApplyStaticEffect(Color color)
 {
     Logger.Debug(() => $"{nameof(ChromaSink)} received {color}. Applying to {string.Join(", ", SupportedDevices)}");
     await Task.WhenAll(SupportedDevices.Select((device) => Client.ApplyStaticEffectAsync(device, color)));
 }