From f4d2e59831b111a5da51db04e9ac618d0b3f3177 Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Sat, 11 Jul 2020 21:14:40 +0200 Subject: [PATCH] Replaced refresh-update with heartbeat --- .../Generic/SteelSeriesDeviceUpdateQueue.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesDeviceUpdateQueue.cs b/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesDeviceUpdateQueue.cs index fe3d576..c2befb6 100644 --- a/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesDeviceUpdateQueue.cs +++ b/RGB.NET.Devices.SteelSeries/Generic/SteelSeriesDeviceUpdateQueue.cs @@ -15,7 +15,6 @@ namespace RGB.NET.Devices.SteelSeries #region Properties & Fields private string _deviceType; - private Dictionary _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); } /// protected override void Update(Dictionary 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 }