public SensorMultiLevelReport2(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)}");
            }

            Type  = (SensorType)payload[0];
            Value = PayloadConverter.ToFloat(payload.Skip(1).ToArray(), out Scale);
            Unit  = GetUnit(Type, Scale);
        }
Esempio n. 2
0
        internal ThermostatSetpointReport(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)}");
            }

            Type  = (ThermostatSetpointType)(payload[0] & 0x1F);
            Value = PayloadConverter.ToFloat(payload.Skip(1).ToArray(), out Scale);
            Unit  = GetUnit(Type, Scale);
        }