mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Replaced refresh-update with heartbeat
This commit is contained in:
parent
5a4294499a
commit
f4d2e59831
@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user