Exemplo n.º 1
0
        /// <summary>
        /// Processes a list of attribute status reports for this cluster
        ///
        /// <param name="reports">List of ReadAttributeStatusRecord</param>
        /// </summary>
        public void HandleAttributeStatus(List <ReadAttributeStatusRecord> records)
        {
            foreach (ReadAttributeStatusRecord record in records)
            {
                if (record.Status != ZclStatus.SUCCESS)
                {
                    //logger.debug("{}: Error reading attribute {} in cluster {} - {}", zigbeeEndpoint.getEndpointAddress(),
                    //        record.getAttributeIdentifier(), clusterId, record.getStatus());
                    continue;
                }

                ZclAttribute attribute = null;
                if (_attributes.TryGetValue(record.AttributeIdentifier, out attribute) == true)
                {
                    if (attribute == null)
                    {
                        //logger.debug("{}: Unknown attribute {} in cluster {}", zigbeeEndpoint.getEndpointAddress(),
                        //        record.getAttributeIdentifier(), clusterId);
                    }
                    else
                    {
                        attribute.UpdateValue(_normalizer.NormalizeZclData(attribute.ZclDataType, record.AttributeValue));
                        NotifyAttributeListener(attribute);
                    }
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Processes a list of attribute reports for this cluster
 ///
 /// <param name="reports">List of AttributeReport</param>
 /// </summary>
 public void HandleAttributeReport(List <AttributeReport> reports)
 {
     foreach (AttributeReport report in reports)
     {
         ZclAttribute attribute = _attributes[report.AttributeIdentifier];
         if (attribute == null)
         {
             //logger.debug("{}: Unknown attribute {} in cluster {}", zigbeeEndpoint.getEndpointAddress(),
             //        report.getAttributeIdentifier(), clusterId);
         }
         else
         {
             attribute.UpdateValue(_normalizer.NormalizeZclData(attribute.ZclDataType, report.AttributeValue));
             NotifyAttributeListener(attribute);
         }
     }
 }