1
0
mirror of https://github.com/DarthAffe/RGB.NET.git synced 2025-12-12 17:48:31 +00:00

Replaced refresh-update with heartbeat

This commit is contained in:
Darth Affe 2020-07-11 21:14:40 +02:00
parent 5a4294499a
commit f4d2e59831

View File

@ -15,7 +15,6 @@ namespace RGB.NET.Devices.SteelSeries
#region Properties & Fields
private string _deviceType;
private Dictionary<object, Color> _lastDataSet;
#endregion
@ -39,20 +38,14 @@ namespace RGB.NET.Devices.SteelSeries
protected override void OnUpdate(object sender, CustomUpdateData customData)
{
if ((customData != null) && (customData["refresh"] as bool? ?? false))
{
if ((_lastDataSet != null) && (_lastDataSet.Count != 0))
Update(_lastDataSet);
}
SteelSeriesSDK.SendHeartbeat();
else
base.OnUpdate(sender, customData);
}
/// <inheritdoc />
protected override void Update(Dictionary<object, Color> dataSet)
{
_lastDataSet = dataSet;
SteelSeriesSDK.UpdateLeds(_deviceType, dataSet.ToDictionary(x => ((SteelSeriesLedId)x.Key).GetAPIName(), x => x.Value.ToIntArray()));
}
=> SteelSeriesSDK.UpdateLeds(_deviceType, dataSet.ToDictionary(x => ((SteelSeriesLedId)x.Key).GetAPIName(), x => x.Value.ToIntArray()));
#endregion
}