Ejemplo n.º 1
0
        /// <summary>
        /// Returns the Attribute value reading the new value.
        /// Note that the parameter is an attribute UUID.
        /// </summary>
        /// <param name="uuid"></param>
        /// <returns></returns>
        public async Task <(AttributeValueDto Data, DataStatus Status)> DataReadValueAsync(Guid uuid)
        {
            var(value, status) = await ReadAttributeValueAsync(uuid);

            if (status.IsGood)
            {
                Data.UpdateValues(new ValueData()
                {
                    Uuid = uuid, Value = value
                });
            }
            else
            {
                _logger?.LogError($"Error code {status.Code} in reading value: {status.Explanation}.");
            }

            Data.Status = status;
            return(value, Data.Status);
        }