def subUpdate(path: TypedAttributePath,
               transaction: SubscriptionTransaction):
     nonlocal updated
     value = transaction.GetAttribute(path)
     logger.info(
         f"Received attribute update path {path}, New value {value}")
     updated = True
Esempio n. 2
0
    def __call__(self, path: TypedAttributePath,
                 transaction: SubscriptionTransaction):
        if path.AttributeType == self._expected_attribute:
            data = transaction.GetAttribute(path)

            value = {
                'name': self._name,
                'endpoint': path.Path.EndpointId,
                'attribute': path.AttributeType,
                'value': data
            }
            logging.info("Got subscription report on client %s for %s: %s" %
                         (self.name, path.AttributeType, data))
            self._output.put(value)