private void When_I_set_the_flashing_speed() { _successful = true; var speeds = Enum.GetValues(typeof(BlyncClient.Speed)).Cast <BlyncClient.Speed>(); foreach (var speed in speeds) { for (var device = 0; device < _blyncClient.NumberOfDevices; device++) { _successful &= _blyncClient.SetFlashSpeed(device, speed); } } }
private void SetFlashSpeed(IEnumerable <int> deviceIds, BlyncClient.Speed flashSpeed) { foreach (var deviceId in deviceIds) { _blyncClient.SetFlashSpeed(deviceId, flashSpeed); } }
private void ProcessFlashSpeed(BlyncClient blyncClient, Options options) { var flashSpeed = options.FlashSpeed ?? 1; BlyncClient.Speed speed; switch (flashSpeed) { case 1: speed = BlyncClient.Speed.Low; break; case 2: speed = BlyncClient.Speed.Medium; break; case 3: speed = BlyncClient.Speed.High; break; default: throw new ArgumentOutOfRangeException(); } foreach (var device in options.Device) { blyncClient.SetFlashSpeed(Int32.Parse(device), speed); } }