예제 #1
0
파일: Color.cs 프로젝트: roblans/ZWave4Net
 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()));
 }
예제 #2
0
        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]);
        }