using System.Collections.Generic;
using RGB.NET.Core;
namespace RGB.NET.Devices.WS281X.Bitwizard;
// ReSharper disable once InconsistentNaming
///
///
/// Represents the update-queue performing updates for a bitwizard WS2812 device.
///
public sealed class BitwizardWS2812USBUpdateQueue : SerialConnectionUpdateQueue
{
#region Constructors
///
///
/// Initializes a new instance of the class.
///
/// The update trigger used by this queue.
/// The serial connection used to access the device.
public BitwizardWS2812USBUpdateQueue(IDeviceUpdateTrigger updateTrigger, ISerialConnection serialConnection)
: base(updateTrigger, serialConnection)
{ }
#endregion
#region Methods
///
protected override void OnStartup(object? sender, CustomUpdateData customData)
{
base.OnStartup(sender, customData);
SendCommand(string.Empty); // Get initial prompt
}
///
protected override IEnumerable GetCommands(IList<(object key, Color color)> dataSet)
{
foreach ((object key, Color value) in dataSet)
yield return $"pix {(int)key} {value.AsRGBHexString(false)}";
}
#endregion
}