diff --git a/RGB.NET.Core/Devices/AbstractRGBDevice.cs b/RGB.NET.Core/Devices/AbstractRGBDevice.cs index 4579c18..0575ca3 100644 --- a/RGB.NET.Core/Devices/AbstractRGBDevice.cs +++ b/RGB.NET.Core/Devices/AbstractRGBDevice.cs @@ -86,7 +86,7 @@ namespace RGB.NET.Core DeviceUpdate(); // Send LEDs to SDK - IEnumerable ledsToUpdate = ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty)).ToList(); + List ledsToUpdate = GetLedsToUpdate(flushLeds)?.ToList() ?? new List(); foreach (Led ledToUpdate in ledsToUpdate) ledToUpdate.Update(); @@ -94,6 +94,8 @@ namespace RGB.NET.Core UpdateLeds(ledsToUpdate); } + protected virtual IEnumerable GetLedsToUpdate(bool flushLeds) => ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty)); + /// public virtual void SyncBack() { }