public async Task Set(ColorComponent[] components) { var payload = new List<byte>(); payload.Add((byte)components.Length); payload.AddRange(components.SelectMany(element => element.ToBytes())); await Channel.Send(Node, new Command(Class, command.Set, payload.ToArray())); }
internal ColorReport(Node node, byte[] payload) : base(node) { if (payload == null) { throw new ArgumentNullException(nameof(payload)); } if (payload.Length < 2) { throw new ReponseFormatException($"The response was not in the expected format. {GetType().Name}: Payload: {BitConverter.ToString(payload)}"); } Component = new ColorComponent(payload[0], payload[1]); }