(self, publishresult)
| 115 | self.server.publish() |
| 116 | |
| 117 | def publish_callback(self, publishresult): |
| 118 | self.logger.info("Publish callback called with result: %s", publishresult) |
| 119 | if not self.is_ready(): |
| 120 | self.logger.warning( |
| 121 | "Result received but subscription not ready %s", publishresult) |
| 122 | return |
| 123 | |
| 124 | if publishresult.NotificationMessage.NotificationData is not None: |
| 125 | for notif in publishresult.NotificationMessage.NotificationData: |
| 126 | if isinstance(notif, ua.DataChangeNotification): |
| 127 | self._call_datachange(notif) |
| 128 | elif isinstance(notif, ua.EventNotificationList): |
| 129 | self._call_event(notif) |
| 130 | elif isinstance(notif, ua.StatusChangeNotification): |
| 131 | self._call_status(notif) |
| 132 | else: |
| 133 | self.logger.warning("Notification type not supported yet for notification %s", notif) |
| 134 | else: |
| 135 | self.logger.warning("NotificationMessage is None.") |
| 136 | |
| 137 | ack = ua.SubscriptionAcknowledgement() |
| 138 | ack.SubscriptionId = self.subscription_id |
| 139 | ack.SequenceNumber = publishresult.NotificationMessage.SequenceNumber |
| 140 | self.server.publish([ack]) |
| 141 | |
| 142 | def _call_datachange(self, datachange): |
| 143 | for item in datachange.MonitoredItems: |
nothing calls this directly
no test coverage detected