Ejemplo n.º 1
0
        /// <summary>
        /// Returns the value of the attribute from the remote attribute. If the current value is newer than refreshPeriod
        /// (in milliseconds) then the current value will be returned, otherwise the value will be requested from the remote device.
        /// </summary>
        /// <param name="refreshPeriod">the number of milliseconds to consider the value current</param>
        /// <returns>an Object with the attribute value, or null on error</returns>
        public async Task <object> ReadValue(long refreshPeriod)
        {
            if (IsLastValueCurrent(refreshPeriod))
            {
                return(LastValue);
            }

            return(await _cluster.ReadAttributeValue(Id));
        }