From ce0152773a099d944b920a1e868431b1370dacc1 Mon Sep 17 00:00:00 2001 From: sagIoTPower Date: Tue, 14 May 2024 16:11:41 +0200 Subject: [PATCH] removed debug messages --- repository/blocks/EnhancedHttpOutputBlock.mon | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/repository/blocks/EnhancedHttpOutputBlock.mon b/repository/blocks/EnhancedHttpOutputBlock.mon index 946db44..c5dee8f 100644 --- a/repository/blocks/EnhancedHttpOutputBlock.mon +++ b/repository/blocks/EnhancedHttpOutputBlock.mon @@ -36,7 +36,7 @@ event HTTPHandler TimerParams tp := TimerParams.relative(0.01).withPayload(res).withPartition(deviceId); base.createTimerWith(tp); - log "Called handleResponse: " + deviceId + "/" + res.payload.data.toString() at INFO; + log "Called handleResponse: " + deviceId + "/" + res.payload.data.toString() at DEBUG; if not res.isSuccess() { log "Unable to connect " +host+". Error code: " + res.statusMessage at WARN; } @@ -107,9 +107,9 @@ event EnhancedHTTPOutput_$Parameters { * An example of HTTP request from the block: * Content-Type: application/json - { "modelName":"model_0", + "deviceId":"84588865186", "value": { "value":true, "timestamp":"1563466239", @@ -170,9 +170,10 @@ event EnhancedHTTPOutput { string modelName := $modelScopeParameters.getOrDefault(ABConstants.MODEL_NAME_IDENTIFIER).valueToString(); any data; + string deviceId := AnyExtractor($activation.partition).getString(""); if $parameters.wrapBody { - data := {"modelName":modelName, "value":$input_value }; // $input_value is a Value object with fields value, timestamp, properties - this will be output as a JSON object. + data := {"modelName":modelName, "value":$input_value, "deviceId": deviceId }; // $input_value is a Value object with fields value, timestamp, properties - this will be output as a JSON object. } else { if $input_value.properties.size() = 0 { // if properties are empty the use the input value @@ -187,8 +188,7 @@ event EnhancedHTTPOutput { Request req := transport.createPOSTRequest($parameters.path, data); // Execute the request and pass the callback action. - string deviceId := AnyExtractor($activation.partition).getString(""); - log "Processing for partition: " + deviceId at INFO; + log "Processing for partition: " + deviceId at DEBUG; req.execute(HTTPHandler(deviceId, $parameters.host, $base).handleResponse); $base.profile(BlockBase.PROFILE_OUTPUT); } @@ -204,7 +204,7 @@ event EnhancedHTTPOutput { dictionary propertyValues := {}; any k; - log "Response raw: " + response.payload.data.toString() at INFO; + log "Response raw: " + response.payload.data.toString() at DEBUG; for k in response.payload.data.getKeys() { propertyValues[k.valueToString()] := response.payload.data.getEntry(k); }