Replaced refresh-update with heartbeat

This commit is contained in:
DarthAffe committed 2020-07-11 21:14:40 +02:00
1 parent 5a4294499a
commit f4d2e59831
1 file changed
+2 -9
@@ -15,7 +15,6 @@ namespace RGB.NET.Devices.SteelSeries
#region Properties & Fields #region Properties & Fields
private string _deviceType; private string _deviceType;
private Dictionary<object, Color> _lastDataSet;
#endregion #endregion
@@ -39,20 +38,14 @@ namespace RGB.NET.Devices.SteelSeries
protected override void OnUpdate(object sender, CustomUpdateData customData) protected override void OnUpdate(object sender, CustomUpdateData customData)
{ {
if ((customData != null) && (customData["refresh"] as bool? ?? false)) if ((customData != null) && (customData["refresh"] as bool? ?? false))
{ SteelSeriesSDK.SendHeartbeat();
if ((_lastDataSet != null) && (_lastDataSet.Count != 0))
Update(_lastDataSet);
}
else else
base.OnUpdate(sender, customData); base.OnUpdate(sender, customData);
} }
/// <inheritdoc /> /// <inheritdoc />
protected override void Update(Dictionary<object, Color> dataSet) protected override void Update(Dictionary<object, Color> dataSet)
{ => SteelSeriesSDK.UpdateLeds(_deviceType, dataSet.ToDictionary(x => ((SteelSeriesLedId)x.Key).GetAPIName(), x => x.Value.ToIntArray()));
_lastDataSet = dataSet;
SteelSeriesSDK.UpdateLeds(_deviceType, dataSet.ToDictionary(x => ((SteelSeriesLedId)x.Key).GetAPIName(), x => x.Value.ToIntArray()));
}
#endregion #endregion
} }