Exemple #1
0
        public void SetColor_ToSingleLed_WithFade_UsesFadingMode()
        {
            var fakeUnderlyingDevice = new FakeHidDevice();

            using (var device = new Device(fakeUnderlyingDevice))
            {
                var color = new Color(0xC8, 0x14, 0x2A);
                device.SetColor(LedTarget.OfIndex(5), color, 64).Wait();
            }

            fakeUnderlyingDevice.AssertMessagesReceived("00:02:05:C8:14:2A:40:00:00");
        }
Exemple #2
0
        public void SetColorThroughPort_ToSingleLed_SimilarResult()
        {
            var fakeUnderlyingDevice = new FakeHidDevice();

            using (var device = new Device(fakeUnderlyingDevice))
            {
                var color = new Color(0xC8, 0x14, 0x2A);
                device.SetColor(LedTarget.OfIndex(4), color, 64).Wait();
                device[4].SetColor(color, 64).Wait();
            }

            fakeUnderlyingDevice.AssertBothMessagesAreEqual();
        }
 /// <summary>
 /// Create the command
 /// </summary>
 /// <param name="target">Specify which leds should blink</param>
 /// <param name="color">Specify the color to which leds should blink</param>
 /// <param name="speed">Abstract duration for the fading effect. The higher, the longer each blink will take.</param>
 /// <param name="repeatCount">Number of time the blink should be repeated</param>
 public BlinkCommand(LedTarget target, Color color, byte speed, byte repeatCount)
     : base(target, color)
 {
     this.Speed       = speed;
     this.RepeatCount = repeatCount;
 }
Exemple #4
0
 /// <summary>
 /// Create the command
 /// </summary>
 /// <param name="target">Specify which leds should be switched</param>
 /// <param name="color">Specify the color to which leds should be switched</param>
 /// <param name="fadeInTime">Abstract duration for the fading effect. The higher, the longer it will take to switch to the color. Null to switch instantaneously</param>
 public FadeToCommand(LedTarget target, Color color, byte fadingDuration)
     : base(target, color)
 {
     this.FadingDuration = fadingDuration;
 }
Exemple #5
0
 public TargettedCommand(LedTarget target, Color color)
     : base(color)
 {
     this.Target = target;
 }
Exemple #6
0
 /// <summary>
 /// Create the command
 /// </summary>
 /// <param name="target">Specify which leds should be switched</param>
 /// <param name="color">Specify the color to which leds should be switched</param>
 public JumpToCommand(LedTarget target, Color color)
     : base(target, color)
 {
 }