Merge pull request #7 from ShvaykaD/feature/delete_attributes_node

add validation for empty list of attributes in save attributes node
This commit is contained in:
Yurii 2022-10-07 12:39:46 +03:00 committed by GitHub
commit 4bbcfb1917
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,6 +66,10 @@ public class TbMsgAttributesNode implements TbNode {
}
String src = msg.getData();
List<AttributeKvEntry> attributes = new ArrayList<>(JsonConverter.convertToAttributes(new JsonParser().parse(src)));
if (attributes.isEmpty()) {
ctx.tellSuccess(msg);
return;
}
String notifyDeviceStr = msg.getMetaData().getValue("notifyDevice");
ctx.getTelemetryService().saveAndNotify(
ctx.getTenantId(),