示例#1
0
        /// <summary>
        /// Create the properties for the StateReport
        /// </summary>
        /// <param name="token"></param>
        /// <param name="device"></param>
        /// <param name="port"></param>
        /// <returns></returns>
        public override async Task <List <Property> > CreateProperties(string token, DeviceDto device, string port)
        {
            LambdaLogger.Log("Brightness StateReport");

            List <Property> properties = new List <Property>();

            FieldValueDto value = await GetFieldValue(token, device, "brightness", port);

            if (value != null && value.v.HasValue)
            {
                var temperatureProperty = new IntValueProperty
                {
                    Namespace    = InterfaceNamespace,
                    Name         = "brightness",
                    Value        = Convert.ToInt32(value.v.Value),
                    TimeOfSample = DateTime.UtcNow,
                    UncertaintyInMilliseconds = 600
                };
                properties.Add(temperatureProperty);
            }

            return(properties);
        }
示例#2
0
 set => SetValue(IntValueProperty, value);