(MAJOR) Added success-indication to device updates and forced flushes after nonsuccessful ones.

Added exception handling the last missing queues.
This commit is contained in:
DarthAffe committed 2023-03-05 18:04:50 +01:00
1 parent 37e4954583
commit 30ccfdcd85
21 files changed
+151 -50

No files matched your search

@@ -46,13 +46,26 @@ internal class SteelSeriesDeviceUpdateQueue : UpdateQueue
}
catch (Exception ex)
{
SteelSeriesDeviceProvider.Instance.Throw(ex, true);
SteelSeriesDeviceProvider.Instance.Throw(ex);
}
}
/// <inheritdoc />
protected override void Update(in ReadOnlySpan<(object key, Color color)> dataSet)
=> SteelSeriesSDK.UpdateLeds(_deviceType, dataSet.ToArray().Select(x => (((SteelSeriesLedId)x.key).GetAPIName(), x.color.ToIntArray())).Where(x => x.Item1 != null).ToList()!);
protected override bool Update(in ReadOnlySpan<(object key, Color color)> dataSet)
{
try
{
SteelSeriesSDK.UpdateLeds(_deviceType, dataSet.ToArray().Select(x => (((SteelSeriesLedId)x.key).GetAPIName(), x.color.ToIntArray())).Where(x => x.Item1 != null).ToList()!);
return true;
}
catch (Exception ex)
{
SteelSeriesDeviceProvider.Instance.Throw(ex);
}
return false;
}
#endregion
}