Repository navigation
Expand file tree
/
Copy pathcheck_is_esp32_firmware_synced.json
More file actions
73 lines (73 loc) · 1.93 KB
/
Copy pathcheck_is_esp32_firmware_synced.json
File metadata and controls
73 lines (73 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
"ruleChain": {
"additionalInfo": {
"description": "Check is ESP32 firmware synced"
},
"name": "Check is ESP32 firmware synced",
"firstRuleNodeId": null,
"root": false,
"debugMode": false,
"configuration": null
},
"metadata": {
"firstNodeIndex": 1,
"nodes": [
{
"additionalInfo": {
"layoutX": 273,
"layoutY": 423
},
"type": "org.thingsboard.rule.engine.telemetry.TbMsgAttributesNode",
"name": "Save 'fwStateIsSynced' attribute",
"debugMode": true,
"configuration": {
"scope": "SERVER_SCOPE"
}
},
{
"additionalInfo": {
"layoutX": 125,
"layoutY": 225
},
"type": "org.thingsboard.rule.engine.metadata.TbGetAttributesNode",
"name": "Add attributes to metadata",
"debugMode": true,
"configuration": {
"clientAttributeNames": [
"currentFwVer"
],
"sharedAttributeNames": [],
"serverAttributeNames": [
"lastTargetFwVer"
],
"latestTsKeyNames": []
}
},
{
"additionalInfo": {
"layoutX": 200,
"layoutY": 325
},
"type": "org.thingsboard.rule.engine.transform.TbTransformMsgNode",
"name": "Update server attribute 'fwStateIsSynced'",
"debugMode": true,
"configuration": {
"jsScript": "msg.fwStateIsSynced = false;\n\nif (metadata.cs_currentFwVer) {\n msg.fwStateIsSynced = metadata.cs_currentFwVer === metadata.ss_lastTargetFwVer;\n}\n\nreturn {msg: msg, metadata: metadata, msgType: 'POST_ATTRIBUTES_REQUEST'};"
}
}
],
"connections": [
{
"fromIndex": 1,
"toIndex": 2,
"type": "Success"
},
{
"fromIndex": 2,
"toIndex": 0,
"type": "Success"
}
],
"ruleChainConnections": null
}
}