Loading src/device/service/DeviceServiceServicerImpl.py +6 −1 Original line number Diff line number Diff line Loading @@ -404,7 +404,10 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): finally: self.mutex_queues.signal_done(device_uuid) def SSETelemetrySubscribe(self, request: SSEMonitoringSubscriptionConfig, context : grpc.ServicerContext) -> SSEMonitoringSubscriptionResponse: @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SSETelemetrySubscribe( self, request: SSEMonitoringSubscriptionConfig, context : grpc.ServicerContext ) -> SSEMonitoringSubscriptionResponse: device_id = request.device_id.device_uuid.uuid config_type = request.config_type context_client = ContextClient() Loading @@ -414,6 +417,7 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): if device is None: raise NotFoundException('Device', device_id, extra_details='loading in ConfigureDevice') driver : _Driver = get_driver(self.driver_instance_cache, device) if config_type == SSEMonitoringSubscriptionConfig.Subscribe: r = driver.SubscribeState([(request.uri, 0, float(request.sampling_interval))]) if len(r) != 1: Loading @@ -422,6 +426,7 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): ) sub_conf: dict = r[0] return SSEMonitoringSubscriptionResponse(identifier=sub_conf['identifier'], uri=sub_conf['uri']) if config_type == SSEMonitoringSubscriptionConfig.Unsubscribe: r = driver.UnsubscribeState([(request.identifier, 0, 0)]) if len(r) != 1: Loading Loading
src/device/service/DeviceServiceServicerImpl.py +6 −1 Original line number Diff line number Diff line Loading @@ -404,7 +404,10 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): finally: self.mutex_queues.signal_done(device_uuid) def SSETelemetrySubscribe(self, request: SSEMonitoringSubscriptionConfig, context : grpc.ServicerContext) -> SSEMonitoringSubscriptionResponse: @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) def SSETelemetrySubscribe( self, request: SSEMonitoringSubscriptionConfig, context : grpc.ServicerContext ) -> SSEMonitoringSubscriptionResponse: device_id = request.device_id.device_uuid.uuid config_type = request.config_type context_client = ContextClient() Loading @@ -414,6 +417,7 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): if device is None: raise NotFoundException('Device', device_id, extra_details='loading in ConfigureDevice') driver : _Driver = get_driver(self.driver_instance_cache, device) if config_type == SSEMonitoringSubscriptionConfig.Subscribe: r = driver.SubscribeState([(request.uri, 0, float(request.sampling_interval))]) if len(r) != 1: Loading @@ -422,6 +426,7 @@ class DeviceServiceServicerImpl(DeviceServiceServicer): ) sub_conf: dict = r[0] return SSEMonitoringSubscriptionResponse(identifier=sub_conf['identifier'], uri=sub_conf['uri']) if config_type == SSEMonitoringSubscriptionConfig.Unsubscribe: r = driver.UnsubscribeState([(request.identifier, 0, 0)]) if len(r) != 1: Loading