def device_send_event(connectionId, eventBody): # noqa: E501 """Send an event # noqa: E501 :param connectionId: Id for the connection :type connectionId: str :param eventBody: :type eventBody: dict | bytes :rtype: None """ if connexion.request.is_json: eventBody = EventBody.from_dict(connexion.request.get_json()) # noqa: E501 # changed from return 'do some magic!' device_glue.send_event(connectionId, eventBody)
def service_send_c2d(connectionId, deviceId, eventBody): # noqa: E501 """Send a c2d message # noqa: E501 :param connectionId: Id for the connection :type connectionId: str :param deviceId: :type deviceId: str :param eventBody: :type eventBody: dict | bytes :rtype: None """ if connexion.request.is_json: eventBody = EventBody.from_dict(connexion.request.get_json()) # noqa: E501 return 'do some magic!'
def module_send_output_event(connectionId, outputName, eventBody): # noqa: E501 """Send an event to a module output # noqa: E501 :param connectionId: Id for the connection :type connectionId: str :param outputName: :type outputName: str :param eventBody: :type eventBody: dict | bytes :rtype: None """ if connexion.request.is_json: eventBody = EventBody.from_dict(connexion.request.get_json()) # noqa: E501 # changed from return 'do some magic!' module_glue.send_output_event_sync(connectionId, outputName, eventBody)
def wait_for_c2d_message_sync(self, connection_id): response = self.object_map[connection_id].wait_for_c2d_message_sync() return EventBody.from_dict(response)
def wait_for_input_message_sync(self, connection_id, input_name): response = self.object_map[connection_id].wait_for_input_message_sync( input_name ) return EventBody.from_dict(response)