internal MultiChannelReport(Node node, byte[] payload) : base(node) { if (payload == null) throw new ArgumentNullException(nameof(payload)); if (payload.Length < 1) throw new ReponseFormatException($"The response was not in the expected format. {GetType().Name}: Payload: {BitConverter.ToString(payload)}"); ControllerID = payload[0]; EndPointID = payload[1]; if (byte.Equals(payload[2], (byte)CommandClass.SwitchBinary) && byte.Equals(payload[3], (byte)SwitchBinary.command.Report)) Report = new SwitchBinaryReport(node, payload.Skip(2 + 2).ToArray()); }
internal MultiChannelReport(Node node, byte[] payload) : base(node) { if (payload == null) { throw new ArgumentNullException(nameof(payload)); } if (payload.Length < 3) { throw new ReponseFormatException($"The response was not in the expected format. {GetType().Name}: Payload: {BitConverter.ToString(payload)}"); } EndPointID = payload[0]; ControllerID = payload[1]; // check sub report if (payload.Length > 3 && payload[2] == Convert.ToByte(CommandClass.SwitchBinary) && payload[3] == Convert.ToByte(SwitchBinary.command.Report)) { Report = new SwitchBinaryReport(node, payload.Skip(4).ToArray <Byte>()); } }
protected void UpdateVariable(NodeReport nodeReport, string variable, object value) { var device = nodeReport.Node.NodeID.ToString("D"); _messageQueue.Publish(new UpdateVariableMessage("zwave", device, variable, value)); }