iobroker.zigbee 3.1.5 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -15
- package/admin/admin.js +672 -224
- package/admin/img/group.png +0 -0
- package/admin/img/restore_backup.png +0 -0
- package/admin/index_m.html +161 -9
- package/admin/tab_m.html +7 -8
- package/docs/de/img/edit_grp.png +0 -0
- package/docs/de/img/edit_image.png +0 -0
- package/docs/de/readme.md +2 -2
- package/docs/en/readme.md +2 -2
- package/io-package.json +27 -27
- package/lib/DeviceDebug.js +1 -1
- package/lib/backup.js +55 -26
- package/lib/commands.js +150 -92
- package/lib/devices.js +10 -1
- package/lib/exclude.js +2 -1
- package/lib/exposes.js +20 -4
- package/lib/groups.js +2 -2
- package/lib/localConfig.js +56 -18
- package/lib/statescontroller.js +81 -50
- package/lib/utils.js +41 -0
- package/lib/zbDelayedAction.js +1 -1
- package/lib/zbDeviceAvailability.js +3 -3
- package/lib/zbDeviceEvent.js +4 -2
- package/lib/zigbeecontroller.js +44 -20
- package/main.js +56 -37
- package/package.json +2 -4
|
Binary file
|
|
Binary file
|
package/admin/index_m.html
CHANGED
|
@@ -326,6 +326,50 @@
|
|
|
326
326
|
#map {
|
|
327
327
|
margin: 0px;
|
|
328
328
|
}
|
|
329
|
+
.dev_list {
|
|
330
|
+
display: block;
|
|
331
|
+
margin-left: auto;
|
|
332
|
+
margin-right: auto;
|
|
333
|
+
width: 80px;
|
|
334
|
+
}
|
|
335
|
+
.sml_list {
|
|
336
|
+
display: flex;
|
|
337
|
+
align-items: center;
|
|
338
|
+
gap: 20px;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
#dataroweven { background-color: #909090; color: #c0c0c0 !important; }
|
|
342
|
+
#datarowodd { background-color: #c0c0c0; color: #202020 !important; }
|
|
343
|
+
#datarowopt { background-color: #707070; color: #c0c0c0 !important; }
|
|
344
|
+
#datatable { background-color: #3090c0; color: #202020 !important; }
|
|
345
|
+
#dataroweven_red { background-color: #909090; color: #c00000 !important; }
|
|
346
|
+
#datarowodd_red { background-color: #C0C0C0; color: #c00000 !important; }
|
|
347
|
+
#datarowopt_red { background-color: #707070; color: #c00000 !important; }
|
|
348
|
+
#datared { color: #C00000 !important;}
|
|
349
|
+
#datalime { background-color: #cddc31; color: #c00000 !important;}
|
|
350
|
+
|
|
351
|
+
.m.react-dark #dataroweven_red {
|
|
352
|
+
background-color: #500000 !important;
|
|
353
|
+
}
|
|
354
|
+
.m.react-dark #datarowodd_red {
|
|
355
|
+
background-color: #400000 !important;
|
|
356
|
+
}
|
|
357
|
+
.m.react-dark #datarowopt_red {
|
|
358
|
+
background-color: #300000 !important;
|
|
359
|
+
}
|
|
360
|
+
.m.react-dark #datarowodd {
|
|
361
|
+
background-color: #303030 !important;
|
|
362
|
+
}
|
|
363
|
+
.m.react-dark #dataroweven {
|
|
364
|
+
background-color: #505050 !important;
|
|
365
|
+
}
|
|
366
|
+
.m.react-dark #datatable {
|
|
367
|
+
background-color: #202020 !important;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.i.middle {
|
|
371
|
+
vertical-align:middle;
|
|
372
|
+
}
|
|
329
373
|
|
|
330
374
|
#tab-main .main-toolbar-table .filter-input {
|
|
331
375
|
display: inline-table;
|
|
@@ -633,6 +677,7 @@
|
|
|
633
677
|
|
|
634
678
|
}
|
|
635
679
|
|
|
680
|
+
|
|
636
681
|
.move-label-up {
|
|
637
682
|
position: absolute !important;
|
|
638
683
|
top: -60px !important;
|
|
@@ -707,7 +752,7 @@
|
|
|
707
752
|
<li class="tab col s2"><a href="#tab-herdsman" id="hardware" class="translate tooltipped">Hardware</a></li>
|
|
708
753
|
<!--<li class="tab col s2"><a href="#tab-map" id="tabmap" class="translate tooltipped">Network map</a></li> -->
|
|
709
754
|
<!--<li class="tab col s1"><a href="#tab-binding" class="translate tooltipped">Binding</a></li> -->
|
|
710
|
-
|
|
755
|
+
<!--<li class="tab col s2"><a href="#tab-exclude" class="translate tooltipped">Local Overrides</a></li>-->
|
|
711
756
|
<li class="tab col s2"><a href="#tab-overrides" class="translate tooltipped">Local Data</a></li>
|
|
712
757
|
<!--<li class="tab col s2"><a href="#tab-main" id="devs" class="translate tooltipped">Devices</a></li>-->
|
|
713
758
|
<li class="tab col s2"><a href="#tab-dev" id="develop" class="translate tooltipped">Developer</a>
|
|
@@ -921,7 +966,8 @@
|
|
|
921
966
|
<a id="show_test_run" class="waves-effect waves-light blue btn"><img class="img-btn" src="img/start_stop.png" title="start / stop" ></a>
|
|
922
967
|
<a id="readNVRam-btn" class="waves-effect waves-light btn"><img class="img-btn" src="img/nvram_read.png" title="read nvram backup" ></a>
|
|
923
968
|
<a id="deleteNVRam-btn" class="waves-effect waves-light btn"><img class="img-btn" src="img/nvram_delete.png" title="remove nvram backup" ></a>
|
|
924
|
-
<a id="reset-btn" class="waves-effect waves-light white-text btn translate"><img class="img-btn" src="img/reset.png" title="reset
|
|
969
|
+
<a id="reset-btn" class="waves-effect waves-light white-text btn translate"><img class="img-btn" src="img/reset.png" title="reset adapter" ></a>
|
|
970
|
+
<a id="restore-backup-btn" class="waves-effect waves-light white-text btn translate"><img class="img-btn" src="img/restore_backup.png" title="restore adapter from backup" ></a>
|
|
925
971
|
</div>
|
|
926
972
|
</div>
|
|
927
973
|
<div class="row textarea">
|
|
@@ -1187,12 +1233,87 @@
|
|
|
1187
1233
|
</ul>
|
|
1188
1234
|
</div>
|
|
1189
1235
|
<div id="tab-overrides" class="col s12 page">
|
|
1236
|
+
<div class="navbar-fixed" style="height: 56px;">
|
|
1237
|
+
<nav class="resposHeight" style="margin-left: -12px; line-height: 24px; width: calc(100% + 24px);">
|
|
1238
|
+
<ul id="nav-mobile-2" class="left">
|
|
1239
|
+
<li>
|
|
1240
|
+
<a id="refresh_models_btn" class="btn-floating waves-effect waves-light tooltipped center-align hoverable translateT" title="refresh data">
|
|
1241
|
+
<i class="material-icons large">refresh</i>
|
|
1242
|
+
</a>
|
|
1243
|
+
</li>
|
|
1244
|
+
<li>
|
|
1245
|
+
<div class="col main-toolbar-table-types-tools main-toolbar-table-filter input-field" style="line-height: 24px;">
|
|
1246
|
+
<i class="material-icons prefix" style="line-height: 24px;">search</i>
|
|
1247
|
+
<input id="model-search" class="filter-input translateP" placeholder="" readonly="readonly" onfocus="if (this.hasAttribute('readonly')) {this.removeAttribute('readonly'); this.blur(); this.focus();}" data-lang-placeholder="Sort">
|
|
1248
|
+
<a class="model-filter-clear btn-floating btn-very-small translateT red lighten-3" title="Очистить" data-lang-title="clear" style="display: none;"><i class="material-icons">clear</i></a>
|
|
1249
|
+
</div>
|
|
1250
|
+
</li>
|
|
1251
|
+
<li>
|
|
1252
|
+
<div class="col input-field" style="line-height: 24px;">
|
|
1253
|
+
<i class="material-icons left" style="line-height: 24px; margin-top: 5px;">sort</i>
|
|
1254
|
+
<a id="model-sort-btn" class="dropdown-trigger btn" href="#" data-target="model-sort">all</a>
|
|
1255
|
+
<ul id="model-sort" class="dropdown-content" tabindex="0">
|
|
1256
|
+
<li class="model-sort-item" data-type="function(a,b) { return true }" tabindex="0">
|
|
1257
|
+
<a class="translate" data-lang="default">default</a></li>
|
|
1258
|
+
<li class="model-sort-item" data-type="by type" tabindex="0">
|
|
1259
|
+
<a class="translate" data-lang="by type">by type</a></li>
|
|
1260
|
+
<li class="model-sort-item" data-type="by device count" tabindex="0">
|
|
1261
|
+
<a class="translate" data-lang="by device count">by device count</a></li>
|
|
1262
|
+
<li class="model-sort-item" data-type="by option count" tabindex="0">
|
|
1263
|
+
<a class="translate" data-lang="by option count">by option count</a></li>
|
|
1264
|
+
</ul>
|
|
1265
|
+
</div>
|
|
1266
|
+
</li>
|
|
1267
|
+
<li>
|
|
1268
|
+
<div class="col input-field" style="line-height: 24px;">
|
|
1269
|
+
<i class="material-icons left" style="line-height: 24px; margin-top: 5px;">filter_list</i>
|
|
1270
|
+
<a id="model-filter-btn" class="dropdown-trigger btn" href="#" data-target="model-filter">all</a>
|
|
1271
|
+
<ul id="model-filter" class="dropdown-content" tabindex="0">
|
|
1272
|
+
<li class="model-filter-item" data-type="with options" tabindex="0"><a class="translate" data-lang="without options">without options</a></li>
|
|
1273
|
+
<li class="model-filter-item" data-type="without options" tabindex="0"><a class="translate" data-lang="with options">with options</a></li>
|
|
1274
|
+
<li class="model-filter-item" data-type="routers" tabindex="0"><a class="translate" data-lang="Routers">Routers</a></li>
|
|
1275
|
+
<li class="model-filter-item" data-type="end devices" tabindex="0"><a class="translate" data-lang="End Devices">End Devices</a></li>
|
|
1276
|
+
<li class="model-filter-item" data-type="groups" tabindex="0"><a class="translate" data-lang="Groups">Groups</a></li>
|
|
1277
|
+
<li class="model-filter-item" data-type="all" tabindex="0"><a class="translate" data-lang="all">all</a></li>
|
|
1278
|
+
</ul>
|
|
1279
|
+
</div>
|
|
1280
|
+
</li>
|
|
1281
|
+
</ul>
|
|
1282
|
+
</nav>
|
|
1283
|
+
</div>
|
|
1284
|
+
<div class="row">
|
|
1285
|
+
<!--
|
|
1286
|
+
<div class="col s1 l1 m1"><a id="modelnamefilter" class="btn-large blue left" ><i class="material-icons icon-blue">filter_list</i></a></div>
|
|
1287
|
+
<div class="col s5 l5 m5 input-field" style="line-height: 24px;"><input id="Filter" type="text" /><label class="translate">Search</div>
|
|
1288
|
+
<div class="col s1 l1 m1"><a id="modelsetfilter" class="btn-large blue left" ><i class="material-icons icon-blue">reorder</i></a></div>
|
|
1289
|
+
<div class="input-field suffix col s2 m2 l2">
|
|
1290
|
+
<select id="channel" class="value">
|
|
1291
|
+
<option value="function(a) { return true }" selected>All</option>
|
|
1292
|
+
<option value="function(a) { return LocalDisplayDataValues[a].type == 'group' }">Groups</option>
|
|
1293
|
+
<option value="function(a) { return LocalDisplayDataValues[a].type == 'Router' }">Routers</option>
|
|
1294
|
+
<option value="function(a) { return LocalDisplayDataValues[a].type == 'Router' }">EndDevices</option>
|
|
1295
|
+
<option value="function(a) { return LocalDisplayDataValues[a].setOptions?.length > 0 }">with Options</option>
|
|
1296
|
+
<option value="function(a) { return !(LocalDisplayDataValues[a].setOptions?.length > 0) }">without Options</option>
|
|
1297
|
+
<label class="translate">Filter</label>
|
|
1298
|
+
</select>
|
|
1299
|
+
</div>
|
|
1300
|
+
<div class="col s1 l1 m1"><a id="modelnamefilter" class="btn-large blue left" ><i class="material-icons icon-blue">sort</i></a></div>
|
|
1301
|
+
<div class="input-field suffix col s2 m2 l2">
|
|
1302
|
+
<select id="channel" class="value">
|
|
1303
|
+
<option value="function(a,b) { return 0 }" selected>noSort</option>
|
|
1304
|
+
<option value="function(a,b) { return LocalDisplayDataValues[a].type > LocalDisplayDataValues[b].type }">by type</option>
|
|
1305
|
+
<option value="function(a,b) { return LocalDisplayDataValues[a].devices?.length > LocalDisplayDataValues[b].devices?.length }">by device counttype</option>
|
|
1306
|
+
<option value="function(a,b) { return LocalDisplayDataValues[a].setOptions?.length > LocalDisplayDataValues[b].setOptions?.length }">by option count</option>
|
|
1307
|
+
<label class="translate">Sort</label>
|
|
1308
|
+
</select>
|
|
1309
|
+
</div></div>
|
|
1190
1310
|
<div class="fixed-action-btn" style="margin-bottom: 100px">
|
|
1191
1311
|
<a id="updateData"
|
|
1192
1312
|
class="btn-floating waves-effect waves-light blue tooltipped center-align hoverable translateT"
|
|
1193
1313
|
title="update Data"><i class="material-icons large">replay</i></a>
|
|
1194
1314
|
</div>
|
|
1195
|
-
|
|
1315
|
+
-->
|
|
1316
|
+
<div id="tab-overrides-content" row>
|
|
1196
1317
|
Nothing to see yet.
|
|
1197
1318
|
</div>
|
|
1198
1319
|
</div>
|
|
@@ -1270,17 +1391,17 @@
|
|
|
1270
1391
|
</div>
|
|
1271
1392
|
</div>
|
|
1272
1393
|
|
|
1273
|
-
<div id="chooseimage" class="modal">
|
|
1394
|
+
<div id="chooseimage" class="modal modal-fixed-footer">
|
|
1274
1395
|
<div class="modal-content">
|
|
1275
1396
|
<div class="row">
|
|
1276
|
-
<h3 class="translate">
|
|
1397
|
+
<h3 class="translate">Edit model options</h3>
|
|
1277
1398
|
<div class="row">
|
|
1278
1399
|
<div class="col s12 input-field">
|
|
1279
1400
|
<input id="d_name" type="text" class="value validate">
|
|
1280
1401
|
<label for="d_name" class="translate">Name</label>
|
|
1281
1402
|
</div>
|
|
1282
1403
|
</div>
|
|
1283
|
-
|
|
1404
|
+
<div class="row">
|
|
1284
1405
|
<div class="col s9 input-field">
|
|
1285
1406
|
<select id="images" class="icons">
|
|
1286
1407
|
</select>
|
|
@@ -1289,15 +1410,26 @@
|
|
|
1289
1410
|
<div class="col s3 ">
|
|
1290
1411
|
<div class="currentIcon"><img src="img/unknown.png"></div>
|
|
1291
1412
|
</div>
|
|
1413
|
+
<div class="col options_grid s12">
|
|
1414
|
+
No Options available
|
|
1415
|
+
</div>
|
|
1416
|
+
<div class="new_options_available">
|
|
1417
|
+
<div class="input-field suffix col s10 m10 l10">
|
|
1418
|
+
<select id="option_Selector" class="materialSelect"></select class="value" />
|
|
1419
|
+
<label for="option_Selector">Available Options</label>
|
|
1420
|
+
</div>
|
|
1421
|
+
<div class="col">
|
|
1422
|
+
<a name="add_options" id="option_add_1084" class="waves-effect waves-green btn-large">
|
|
1423
|
+
<i class="material-icons large icon-green">add_circle</i></a>
|
|
1424
|
+
</div>
|
|
1425
|
+
</div>
|
|
1292
1426
|
</div>
|
|
1293
1427
|
</div>
|
|
1294
|
-
<div class="row">
|
|
1295
|
-
</div>
|
|
1296
1428
|
</div>
|
|
1297
1429
|
<div class="modal-footer">
|
|
1298
1430
|
<div class="forcedelete" id = "globaldiv">
|
|
1299
1431
|
<label>
|
|
1300
|
-
<input id="globaloverride" type="checkbox" class="value"/>
|
|
1432
|
+
<input id="globaloverride" type="checkbox" class="value filled-in" checked="checked" disabled="disabled"/>
|
|
1301
1433
|
<span class="translate" for="globaloverride">Apply to model</span>
|
|
1302
1434
|
</label>
|
|
1303
1435
|
</div>
|
|
@@ -1396,6 +1528,26 @@
|
|
|
1396
1528
|
</div>
|
|
1397
1529
|
</div>
|
|
1398
1530
|
|
|
1531
|
+
<div id="modalrestore" class="modal">
|
|
1532
|
+
<div class="modal-content">
|
|
1533
|
+
<h3 class="translate">Select backup to restore</h3>
|
|
1534
|
+
<!--p class="translate">Restore Info</p-->
|
|
1535
|
+
<div class="new_backups_available">
|
|
1536
|
+
<div class="input-field suffix col s10 m10 l10">
|
|
1537
|
+
<select id="backup_Selector" class="materialSelect"></select class="value" />
|
|
1538
|
+
<label for="backup_Selector">Available Backups</label>
|
|
1539
|
+
</div>
|
|
1540
|
+
<div class="col col s2 m2 l2">
|
|
1541
|
+
<a name="restore_this" id="restore_this" class="waves-effect waves-green btn-large">
|
|
1542
|
+
<i class="material-icons large icon-green tooltipped" title="restore">beenhere</i></a>
|
|
1543
|
+
</div>
|
|
1544
|
+
</div>
|
|
1545
|
+
</div>
|
|
1546
|
+
<div class="modal-footer">
|
|
1547
|
+
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat translate">Cancel</a>
|
|
1548
|
+
</div>
|
|
1549
|
+
</div>
|
|
1550
|
+
|
|
1399
1551
|
<div id="modalviewconfig" class="modal modal-fixed-footer">
|
|
1400
1552
|
<div class="modal-content">
|
|
1401
1553
|
<h3 class="translate">Map view config</h3>
|
package/admin/tab_m.html
CHANGED
|
@@ -943,11 +943,11 @@
|
|
|
943
943
|
|
|
944
944
|
<div id="modaledit" class="modal">
|
|
945
945
|
<div class="modal-content">
|
|
946
|
-
<h3 class="translate">
|
|
946
|
+
<h3 class="translate">Group device</h3>
|
|
947
947
|
<div class="row">
|
|
948
948
|
<div class="col s12">
|
|
949
949
|
<div class="input-field">
|
|
950
|
-
<input id="d_name" type="text" class="value validate">
|
|
950
|
+
<input disabled id="d_name" type="text" class="value validate">
|
|
951
951
|
<label for="d_name" class="translate">Name</label>
|
|
952
952
|
</div>
|
|
953
953
|
</div>
|
|
@@ -1008,7 +1008,7 @@
|
|
|
1008
1008
|
<div id="groupedit" class="modal">
|
|
1009
1009
|
<div class="modal-content">
|
|
1010
1010
|
<div class = "editgroup">
|
|
1011
|
-
<h3 class="translate">Edit
|
|
1011
|
+
<h3 class="translate">Edit group members</h3>
|
|
1012
1012
|
</div>
|
|
1013
1013
|
<div class="row">
|
|
1014
1014
|
<div class="col s4 m4 l2 hide">
|
|
@@ -1018,7 +1018,7 @@
|
|
|
1018
1018
|
</div>
|
|
1019
1019
|
</div>
|
|
1020
1020
|
<div class="input-field col s8 m8 l10">
|
|
1021
|
-
<input id="g_name" type="text" class="value validate">
|
|
1021
|
+
<input id="g_name" type="text" class="value validate" disabled="">
|
|
1022
1022
|
<label for="g_name" class="translate">Name</label>
|
|
1023
1023
|
</div>
|
|
1024
1024
|
</div>
|
|
@@ -1054,7 +1054,7 @@
|
|
|
1054
1054
|
<div id="chooseimage" class="modal modal-fixed-footer">
|
|
1055
1055
|
<div class="modal-content">
|
|
1056
1056
|
<div class="row">
|
|
1057
|
-
<h3 class="translate">
|
|
1057
|
+
<h3 class="translate">Edit device options</h3>
|
|
1058
1058
|
<div class="row">
|
|
1059
1059
|
<div class="col s12 input-field">
|
|
1060
1060
|
<input id="d_name" type="text" class="value validate">
|
|
@@ -1087,11 +1087,10 @@
|
|
|
1087
1087
|
</div>
|
|
1088
1088
|
</div>
|
|
1089
1089
|
<div class="modal-footer">
|
|
1090
|
-
<div class="forcedelete" id = "globaldiv">
|
|
1090
|
+
<div class="forcedelete hide" id = "globaldiv">
|
|
1091
1091
|
<label>
|
|
1092
1092
|
<input id="globaloverride" type="checkbox" class="value"/>
|
|
1093
1093
|
<span class="translate" for="globaloverride">Apply to model</span>
|
|
1094
|
-
</label>
|
|
1095
1094
|
</div>
|
|
1096
1095
|
<a name="save" href="#!" class="modal-action modal-close waves-effect waves-green btn green translate">Save</a>
|
|
1097
1096
|
<a href="#!" class="modal-action modal-close waves-effect waves-red btn-flat translate">Cancel</a>
|
|
@@ -1153,7 +1152,7 @@
|
|
|
1153
1152
|
</div>
|
|
1154
1153
|
<div class="modal-footer">
|
|
1155
1154
|
<a name="IEEE" href="#!" class="modal-action waves-effect waves-red btn-flat left">Network</a>
|
|
1156
|
-
<a name="endpairing" id="endpairing" href="#!" class="
|
|
1155
|
+
<a name="endpairing" id="endpairing" href="#!" class="waves-effect waves-red btn red translate">Stop</a>
|
|
1157
1156
|
<a name="extendpairing" id="extendpairing" href="#!" class="modal-action waves-effect waves-green btn green translate">Extend</a>
|
|
1158
1157
|
<a name="hide" href="#!" class="modal-action modal-close waves-effect waves-green btn green translate">Hide</a>
|
|
1159
1158
|
</div>
|
package/docs/de/img/edit_grp.png
CHANGED
|
Binary file
|
|
Binary file
|
package/docs/de/readme.md
CHANGED
|
@@ -124,9 +124,9 @@ In Beiden Fällen ist es hinreichend den Adapter neu zu starten - die entspreche
|
|
|
124
124
|
|  | Info <br> Öffnet die Informationsanzeige zum Gerät. Die auf dieser Seite dargestellten Informationen stammen direkt vom Gerät. Sie sind auch für unbekannte Geräte verfügbar. |
|
|
125
125
|
|  | Gerät debuggen <br> Aktiviert / deaktivert die Erzeugung von erweiterten Debug-Meldungen für dieses Gerät. Die Farbe des Icons zeigt den aktuellen Status an: (Schwarz/Weiss: keine Debug Meldungen, Grün Debug Meldungen - deaktivierbar mit dieser Schaltflächce. Orange - Debug Meldungen via Filter unter zigbee.x.info.debugmessages. |
|
|
126
126
|
|  | An/Aus <br> Mit dieser Schaltfläche kann ein Gerät aktiviert / deaktiviert werden. Mit deaktiverten Geräten findet keine Kommunikation statt. |
|
|
127
|
-
|  | Bild / Name zusweisen <br> Mit dieser Schaltfläche ist es Möglich
|
|
127
|
+
|  | Bild / Name zusweisen <br> Mit dieser Schaltfläche ist es Möglich die Bezeichnung des Gerätes, das Bild des Gerätes oder die Optionen des Gerätes anzupassen. Wichtig - die Einstellungen können hier **nur** auf Gerätebasis durchgeführt werden. Die Vorgabe auf Modellbasis ist in der Konfiguration hinterlegt.Vorgaben die so gemacht werden bleiben erhalten wenn das Gerät gelöscht wird. |
|
|
128
128
|
|  | Das Gerät konfigurieren. <br> Mit dieser Schaltfläche ist es Möglich für das Gerät erneut zu konfigurieren. Dabei wird der *Converter* Angewiesen die Aktionen durchzufuehren die zur Konfiguration vorgesehen sind. Ueblicherweise werden damit verscheidene Cluster / Attribute an den Koordinator gebunden, um dafuer zu sorgen das das Gerät Informationen *Event* getriggert an den Koordinator sendet.<br>Damit dieses erfolgreich ist muss das Gerät aktiv sein. Insbesondere bei Batterie-betriebenen Geräten ist das of nut kurz nach einer Aktivierung der Fall.<br>Bei einer erfolgreichen Konfiguration verschwindet der Dialog ohne weitere Meldung, und es wird eine Info Meldung im Log platziert. Nur wenn die Konfiguration nicht erfolgreich war gibt es eine Meldung. Dabei sind 2 Arten von Meldungen zu unterscheiden - eine allgemeine Zeitüberschreitung (The device did not repond in time to the configuration request. Another attempt will be made when the device is awake.) oder eine echte Fehlermeldung. Im Falle der Zeitüberschreitung wird das Gerät in eine Liste eingetragen und bei der naechsten Kontaktaufnahme konfiguriert. Im Fehlerfall unterbleibt die Konfiguration. |
|
|
129
|
-
|  | Name / Gruppen editieren <br> Über diese Schaltfläche lässt sich
|
|
129
|
+
|  | Name / Gruppen editieren <br> Über diese Schaltfläche lässt sich die Zuordnung des Gerätes zu einer oder mehreren Gruppen anpassen. Der Button ist nur bei Geräten verfügbar die sich auch gruppieren lassen. Hinweis: Fernbedienungen werden den Gruppen nicht hinzugefügt - statt dessen müssen diese via 'binding' an die Gruppe gebunden werden. |
|
|
130
130
|
|  | Gerät löschen <br> Started den Löschvorgang für dieses Gerät. |
|
|
131
131
|
|
|
132
132
|
## Zusätzliche Informationen
|
package/docs/en/readme.md
CHANGED
|
@@ -122,8 +122,8 @@ In both cases, restarting the adapter is sufficient – the adapter's corr
|
|
|
122
122
|
|  | (re)configure the device. <br> This button allows to trigger a device configuration, which is used to tell the device what data to report automatically to the coordinator. The configuration items are defined in the *converter* for this device. Note that the device needs to be active for a configuration attempt to be successful. If the device is not active, the attempt will time out, and the device will be placed in a queue of devices to be configured the next time the device i sends a message. |
|
|
123
123
|
|  | Debug device <br> Enables / disables the generation of extended debug messages for this device. The color of the icon indicates the current status: (Black/White: no debug messages, Green: debug messages - can be deactivated with this button. Orange: debug messages via filter under zigbee.x.info.debugmessages. |
|
|
124
124
|
|  | On/Off <br> This button can be used to activate/deactivate a device. No communication takes place with deactivated devices. |
|
|
125
|
-
|  | Assign image/name <br> This button allows you to
|
|
126
|
-
|  | Edit name/groups <br> This button can be used
|
|
125
|
+
|  | Assign image/name <br> This button allows you to Assign a name, an icon or options for a specific device. Note that this assignment is **solely** on device level. model-level assingment is done via the settings. Settings made in this way are retained even if the device is deleted. |
|
|
126
|
+
|  | Edit name/groups <br> This button can be used change the devices associationw ith one or more groups. This button is only available on devices which can be assigned to groups. Note: Remotes are not added to the groups - they need to be bound to the group using the 'binding' tab. |
|
|
127
127
|
|  | Delete device <br> Starts the deletion process for this device. |
|
|
128
128
|
## Additional information
|
|
129
129
|
The Zigbee-Adapter shares the same libraries (zigbee-herdsman, zigbee-herdsman-converters) asn the [Zigbee2mqtt](https://www.zigbee2mqtt.io/) Project ([Github Link](https://github.com/Koenkk/zigbee2mqtt)). It is possible to use zigbee2mqtt.io directly with ioBroker using MQTT or its own [Adapter](https://github.com/arteck/ioBroker.zigbee2mqtt).<br>
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "zigbee",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.2.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"3.2.0": {
|
|
7
|
+
"en": "remove local overrides tab from config\nestablish local data tab in config to edit global and device level settings and options\nremove the local overrides tab\nremove the ability to set model level overrides from device tab.\nfix errors for 'polling' devices with changed poll times.\nwarning icon for devices which are not completely interviewed.\nimproved router detection for opening the network\nbugfix: open network on router\nZHC 25.x latest, ZH 6.1.3,\nrestore from in-adapter backup",
|
|
8
|
+
"de": "entfernen sie lokale overrides tab von config\nlokale daten tab erstellen, um globale und geräteebene einstellungen und optionen zu bearbeiten\nentfernen der lokalen overrides tab\nentfernen sie die fähigkeit, modellebene überschrieben von der geräte-tab.\nfehler für \"polling\"-geräte mit veränderten abfragezeiten beheben.\nwarnsymbol für geräte, die nicht vollständig interviewt werden.\nverbesserte routererkennung zum öffnen des netzwerks\nbugfix: offenes netzwerk auf router\nZHC 25.x neueste, ZH 6.1.3,\nwiederherstellung von in-adapter-backup",
|
|
9
|
+
"ru": "удалить локальную вкладку overrided из конфигураций\nустановить локальную вкладку данных в конфигурацию для редактирования глобальных настроек и параметров уровня устройства\nудалить вкладку local overrides\nудалить возможность установки переопределений уровня модели из вкладки устройства.\nисправление ошибок для «опросных» устройств с измененным временем опроса.\nиконка предупреждения для устройств, которые не были полностью опрошены.\nулучшенное обнаружение маршрутизатора для открытия сети\nbugfix: открытая сеть на маршрутизаторе\nZHC 25.x, ZH 6.1.3,\nвосстановление из in-adapter backup",
|
|
10
|
+
"pt": "remover a página de substituições locais da configuração\nestabelecer a página de dados locais na configuração para editar as configurações e opções globais e de nível do dispositivo\nremover a página de sobreposições locais\nremover a capacidade de definir os comandos de nível do modelo da aba do dispositivo.\ncorrigir erros para dispositivos de 'polling' com tempos de votação alterados.\nícone de aviso para dispositivos que não são completamente entrevistados.\ndetecção de roteador melhorada para abrir a rede\ncorreção de erros: abrir rede no roteador\nZHC 25.x mais recente, ZH 6.1.3,\nrestaurar a partir de backup no adaptador",
|
|
11
|
+
"nl": "tabblad overrides verwijderen uit config\nlokale datatabblad instellen in config om instellingen en opties voor het niveau van het apparaat en de globale instellingen te bewerken\nhet tabblad lokale overrides verwijderen\nverwijder de mogelijkheid om modelniveau overrides van apparaat tab.\nfouten te herstellen voor 'polling' apparaten met veranderde polltijden.\nwaarschuwingspictogram voor apparaten die niet volledig zijn geïnterviewd.\nverbeterde routerdetectie voor het openen van het netwerk\nbugfix: open netwerk op router\nZHC 25.x laatste, ZH 6.1.3,\nherstellen van in-adapter back-up",
|
|
12
|
+
"fr": "supprimer l'onglet local de la configuration\ncréer un onglet local de données dans la configuration pour modifier les paramètres et les options de niveau global et périphérique\nsupprimer l'onglet local de remplacement\nsupprimer la possibilité de définir les dépassements de niveau du modèle de l'onglet périphérique.\ncorriger les erreurs pour les dispositifs 'polling' avec des temps de sondage modifiés.\nicône d'avertissement pour les appareils qui ne sont pas complètement interviewés.\namélioration de la détection du routeur pour l'ouverture du réseau\nbugfix: ouvrir le réseau sur le routeur\nZHC 25.x dernier, ZH 6.1.3,\nrestaurer à partir de la sauvegarde dans l'adaptateur",
|
|
13
|
+
"it": "rimuovere la scheda override locale da config\nstabilire la scheda dati locale in configurazione per modificare le impostazioni e le opzioni del livello globale e del dispositivo\nrimuovere la scheda override locale\nrimuovere la capacità di impostare override di livello del modello dalla scheda del dispositivo.\ncorreggere gli errori per i dispositivi 'polling' con tempi di sondaggio modificati.\nicona di avviso per dispositivi che non sono completamente intervistati.\nmiglioramento del rilevamento del router per l'apertura della rete\nbugfix: aprire la rete sul router\nZHC 25.x ultimo, ZH 6.1.3,\nripristino da backup in-adapter",
|
|
14
|
+
"es": "eliminar la pestaña de anulaciones locales de config\nestablecer la ficha de datos local en config para editar ajustes y opciones a nivel global y de dispositivos\neliminar la ficha de anulación local\neliminar la capacidad de establecer el nivel de modelo anula de la pestaña dispositivo.\ncorrige errores para dispositivos 'polling' con tiempos de votación cambiados.\nicono de advertencia para dispositivos que no son entrevistados por completo.\nmejor detección de router para abrir la red\nbugfix: red abierta en router\nZHC 25.x más reciente, ZH 6.1.3,\nrestaurar de la copia de seguridad en el equipo",
|
|
15
|
+
"pl": "usuń lokalne nadjazdy z zakładki config\ntworzy lokalną kartę danych w konfigu, aby edytować globalne i na poziomie urządzenia ustawienia i opcje\nusuń kartę lokalnych nadwozi\nusuń możliwość ustawiania nadwyżek poziomu modelu z zakładki urządzenia.\nnaprawić błędy urządzeń 'sondażowych' ze zmienionymi okresami ankiety.\nikona ostrzegawcza dla urządzeń, które nie są w pełni przesłuchane.\nulepszone wykrywanie routerów w celu otwarcia sieci\nbugfix: otwarta sieć na routerze\nZHC 25.x najnowszy, ZH 6.1.3,\nprzywracanie z kopii zapasowej in- adaptera",
|
|
16
|
+
"uk": "видалити локальну вкладку overrides з налаштування\nвстановити локальну вкладку даних в конфігурацію для редагування параметрів рівня глобального та пристрою та параметрів\nвидалити локальну вкладку\nприбрати можливість встановити рівень моделі перенаряддя з вкладки пристрою.\nфіксувати помилки для пристроїв «запилення» з змінними термінами опитування.\nзначок попередження для пристроїв, які не повністю опитуються.\nполіпшення виявлення маршрутизатора для відкриття мережі\nвиправлення помилок: відкрита мережа на маршрутизаторі\nZHC 25.x останнє, ZH 6.1.3,\nвідновлення з резервної копії",
|
|
17
|
+
"zh-cn": "从配置中删除本地覆盖标签\n在配置中建立本地数据标签以编辑全局和设备级别设置和选项\n删除本地覆盖标签\n从设备标签中删除设置模型级别覆盖的能力 .\n修正“ 投票” 设备的错误, 并更改投票时间 .\n警告未完全访问设备的图标.\n为打开网络改进路由器检测\n错误修正: 在路由器上打开网络\nZHC 25.x最新版,ZH 6.1.3,\n从适应中备份恢复"
|
|
18
|
+
},
|
|
19
|
+
"3.1.6": {
|
|
20
|
+
"en": "Bugfixes\n",
|
|
21
|
+
"de": "Bugfixes\n",
|
|
22
|
+
"ru": "Багфиксы\n",
|
|
23
|
+
"pt": "Correcções de Erros\n",
|
|
24
|
+
"nl": "Bugfixes\n",
|
|
25
|
+
"fr": "Fixes de bogue\n",
|
|
26
|
+
"it": "Bugfix\n",
|
|
27
|
+
"es": "Bugfixes\n",
|
|
28
|
+
"pl": "Korekty błędów\n",
|
|
29
|
+
"uk": "Помилки\n",
|
|
30
|
+
"zh-cn": "错误修正\n"
|
|
31
|
+
},
|
|
6
32
|
"3.1.5": {
|
|
7
33
|
"en": "Bugfixes\nZHC25.36.0\nreduced stopTimeout to 5s",
|
|
8
34
|
"de": "Bugfixes\nZHC25.36.0\nreduzierter StopTimeout auf 5s",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "naprawić błąd 'icon' dla nieznanych urządzeń\nfix state for level.color.rgb role (hex _ color, akceptuje tylko # rrggbb values\nZH 4.4.1\nZHC 23.72.1\nprzygotowanie do złamania zmian w ZHC 24.0.0",
|
|
68
94
|
"uk": "виправлено помилку 'icon' для невідомих пристроїв\nвиправити стан для рівня.color.rgb роль (hex_color, приймає тільки значення #rrggbb\nЗХ 4.4.1\nЗХК 23.72.1\nпідготовка до зміни розриву в ЗЖК 24.0.0",
|
|
69
95
|
"zh-cn": "修复未知设备的“ icon” 错误\n级的固定状态.color.rgb 角色(hex_color,只接受#rrggbb值)\n兹哈4.4.1\nZHC 23.72.1 电话\n准备打破ZHC 24.0"
|
|
70
|
-
},
|
|
71
|
-
"3.0.2": {
|
|
72
|
-
"en": "fix images",
|
|
73
|
-
"de": "bilder",
|
|
74
|
-
"ru": "фиксировать изображения",
|
|
75
|
-
"pt": "corrigir imagens",
|
|
76
|
-
"nl": "afbeeldingen herstellen",
|
|
77
|
-
"fr": "réparer les images",
|
|
78
|
-
"it": "fissare le immagini",
|
|
79
|
-
"es": "fijar imágenes",
|
|
80
|
-
"pl": "poprawianie obrazów",
|
|
81
|
-
"uk": "фіксувати зображення",
|
|
82
|
-
"zh-cn": "修正图像"
|
|
83
|
-
},
|
|
84
|
-
"3.0.1": {
|
|
85
|
-
"en": "Fix for Ikea SOMRIG configuration raising 'definition.endpoint is not a function' error.\nAccess to 'zigbee2mqtt options as settings in zigbee adapter (ALPHA Stage !)\nFix for 'error: zigbee.0 (1118300) zigbee.0 already running' at adapter start (Alpha Stage)\nUpdated hardware configuration panel - exchanged text buttons for buttons with icons.\nLimited states on device tiles to states which are read only or which can be modified sensibly via the device tile.\n",
|
|
86
|
-
"de": "Fix für Ikea SOMRIG Konfiguration erhöhen 'Definition. Endpoint ist kein Funktionsfehler.\nZugriff auf 'zigbee2mqtt Optionen als Einstellungen im Zickbee Adapter (ALPHA Stage!)\nFix für 'error: zigbee.0 (1118300) zigbee.0 bereits läuft' bei Adapterstart (Alpha Stage)\nAktualisiertes Hardware-Konfigurationsfeld - ausgetauschte Texttasten für Tasten mit Symbolen.\nBegrenzte Zustände auf Gerätefliesen zu Zuständen, die nur gelesen werden oder über die Gerätefliese sensibel modifiziert werden können.\n",
|
|
87
|
-
"ru": "Исправьте конфигурацию IKEA SOMRIG, повысив «определение». Конечная точка не является ошибкой функции.\nДоступ к опциям Zigbee2mqtt в качестве настроек в адаптере Zigbee (стадия ALPHA!)\nИсправьте ошибку: zigbee.0 (1118300) zigbee.0 уже работает на старте адаптера\nОбновленная аппаратная панель конфигурации - обмен текстовыми кнопками на кнопки с иконками.\nОграниченные состояния на плитках устройства к состояниям, которые читаются только или которые могут быть изменены чувственно через плитку устройства.\n",
|
|
88
|
-
"pt": "Corrigir para configuração Ikea SOMRIG elevando 'definição. endpoint não é um erro de função.\nAcesso às opções \"zigbee2mqttt como configurações no adaptador zigbee (Estação LAPHA!)\nFix for 'error: zigbee.0 (1118300) zigbee.0 já em execução' no início do adaptador (Alpha Stage)\nPainel de configuração de hardware atualizado - botões de texto trocados para botões com ícones.\nEstados limitados em telhas de dispositivo para estados que são lidos apenas ou que podem ser modificados sensivelmente através da telha do dispositivo.\n",
|
|
89
|
-
"nl": "Fix voor Ikea SOMRIG configuratie verhogen 'definitie. eindpunt is geen functiefout.\nToegang tot 'zigbee2mqtt opties als instellingen in zigbee adapter (ALPHA Stage !)\nFix voor 'fout: zigbee.0 (1118300) zigbee.0 al actief' bij adapterstart (Alpha Stage)\nBijgewerkt hardware configuratiepaneel - uitgewisselde tekstknoppen voor knoppen met pictogrammen.\nBeperkte toestanden op apparaattegels naar toestanden die alleen worden gelezen of die verstandig kunnen worden gewijzigd via de apparaattegel.\n",
|
|
90
|
-
"fr": "Correction pour la configuration Ikea SOMRIG augmentant la définition. le paramètre n'est pas une erreur de fonction.\nAccès aux options 'zigbee2mqtt comme réglages dans l'adaptateur zigbee (ALPHA Stage !)\nCorrection pour 'erreur: zigbee.0 (1118300) zigbee.0 déjà en cours d'exécution' au démarrage de l'adaptateur (Alpha Stage)\nPanneau de configuration du matériel mis à jour - boutons texte échangés pour les boutons avec des icônes.\nLes états limités sur les tuiles de l'appareil aux états qui sont lus seulement ou qui peuvent être modifiés de façon sensible via la tuile de l'appareil.\n",
|
|
91
|
-
"it": "Fissare per Ikea SOMRIG configurazione aumentando 'definizione. endpoint non è un errore di funzione.\nAccesso alle opzioni 'zigbee2mqtt come impostazioni nell'adattatore zigbee (ALPHA Stage !)\nCorrezione per 'error: zigbee.0 (1118300) zigbee.0 già in esecuzione' all'inizio dell'adattatore (Alpha Stage)\nPannello di configurazione hardware aggiornato - pulsanti di testo scambiati per pulsanti con icone.\nStati limitati su piastrelle di dispositivo a stati che sono letti solo o che possono essere modificati sensibilmente tramite la piastrella del dispositivo.\n",
|
|
92
|
-
"es": "Arregla para la configuración de Ikea SOMRIG criando 'definición. endpoint no es un error de función.\nAcceso a las opciones 'zigbee2mqtt como configuración en el adaptador de zigbee (ALPHA Stage !)\nFijación para 'error: zigbee.0 (1118300) zigbee.0 ya funcionando en el inicio del adaptador (Alpha Stage)\nPanel de configuración de hardware actualizado - botones de texto intercambiados para botones con iconos.\nEstados limitados en fichas de dispositivo a estados que se leen solamente o que pueden ser modificados de forma sensata a través de la ficha del dispositivo.\n",
|
|
93
|
-
"pl": "Napraw dla definicji podnoszenie konfiguracji Ikea SOMRIG. Punkt końcowy nie jest błędem funkcji.\nDostęp do opcji 'zigbee2mqtt jako ustawień w adapterze zigbee (ALPHA Stage!)\nFix for 'error: zigbee.0 (1118300) zigbee.0 already running' at adapter start (Alpha Stage)\nAktualizacja panelu konfiguracji sprzętowej - wymieniono przyciski tekstowe na przyciski z ikonami.\nOgraniczone stany na płytkach urządzenia do stanów, które są tylko odczytywane lub które mogą być modyfikowane w sposób rozsądny za pomocą płytki urządzenia.\n",
|
|
94
|
-
"uk": "Виправлення для налаштування Ikea SOMRIG 'Визначення. кінцева точка не є помилкою функції.\nДоступ до опцій Zigbee2mqtt як налаштування адаптера Zigbee (ALPHA Stage !)\nВиправлення для 'error: zigbee.0 (1118300) zigbee.0 вже запущений' при запуску адаптера (Alpha Stage)\nОновлена панель конфігурації обладнання - обмінні текстові кнопки для гудзиків з іконками.\nОбмежені стани на плитці пристрою для станів, які читаються тільки або які можуть бути змінені, швидко через плитку пристрою.\n",
|
|
95
|
-
"zh-cn": "修复Ikea SOMRIG 配置提升定义 。 结束点不是一个函数'错误.\n访问 'zigbee2mqtt 选项作为 Zigbee 适配器的设置( ALPHA stage !) \n在适配器启动( Alpha Stage)时为 'error: zigbee. 0 (1118300) zigbee. 0 已经运行' 进行修复\n更新的硬件配置面板 - 用图标交换文本按钮作为按钮.\n将设备瓦片的状态限制在只读或通过设备瓦片可敏感修改的状态.\n"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/lib/DeviceDebug.js
CHANGED
|
@@ -27,7 +27,7 @@ class DeviceDebug extends EventEmitter {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
start(statescontroller, zigbeecontroller) {
|
|
30
|
-
this.
|
|
30
|
+
this.debug('--- creating device debug ---');
|
|
31
31
|
statescontroller.on('device_debug', this.onDebugEvent.bind(this))
|
|
32
32
|
this.adapter.on('device_debug', this.onDebugEvent.bind(this))
|
|
33
33
|
zigbeecontroller.on('device_debug', this.onDebugEvent.bind(this))
|
package/lib/backup.js
CHANGED
|
@@ -8,6 +8,7 @@ class Backup {
|
|
|
8
8
|
this.adapter = adapter;
|
|
9
9
|
this.adapter.on('message', this.onMessage.bind(this));
|
|
10
10
|
this.inProgress = new Set();
|
|
11
|
+
this.options = {};
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
start(zbController, stController) {
|
|
@@ -40,10 +41,13 @@ class Backup {
|
|
|
40
41
|
if (typeof obj === 'object' && obj.command) {
|
|
41
42
|
switch (obj.command) {
|
|
42
43
|
case 'listbackups':
|
|
43
|
-
this.listbackups(obj);
|
|
44
|
+
this.listbackups(obj.from, obj.command, obj.message, obj.callback);
|
|
44
45
|
break;
|
|
45
46
|
case 'restore':
|
|
46
|
-
this.restore(obj);
|
|
47
|
+
this.restore(obj.from, obj.command, obj.message, obj.callback);
|
|
48
|
+
break;
|
|
49
|
+
case 'backup':
|
|
50
|
+
this.backup(() => this.sendTo(obj.from, obj.command, obj.message, obj.callback));
|
|
47
51
|
break;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
@@ -51,19 +55,22 @@ class Backup {
|
|
|
51
55
|
|
|
52
56
|
async configure(zigbeeOptions) {
|
|
53
57
|
this.zigbeeOptions = zigbeeOptions;
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
this.
|
|
58
|
+
this.options = zigbeeOptions;
|
|
59
|
+
this.backup();
|
|
60
|
+
const allBackupFiles = this.listBackupsFiles();
|
|
61
|
+
this.delBackupsFiles(allBackupFiles);
|
|
57
62
|
}
|
|
58
63
|
|
|
59
|
-
backup(
|
|
64
|
+
backup(callback) {
|
|
60
65
|
// backup prior database and nv data before start adapter
|
|
61
66
|
const files = [];
|
|
67
|
+
const options = this.options;
|
|
62
68
|
if (options.disableBackup) {
|
|
63
69
|
this.info(`internal Backups are disabled`);
|
|
64
70
|
} else {
|
|
65
71
|
if (fs.existsSync(pathLib.join(options.dbDir, options.backupPath))) files.push(options.backupPath);
|
|
66
72
|
if (fs.existsSync(pathLib.join(options.dbDir, options.dbPath))) files.push(options.dbPath);
|
|
73
|
+
if (fs.existsSync(pathLib.join(options.dbDir, options.localConfigPath))) files.push(options.localConfigPath);
|
|
67
74
|
if (files.length == 0) return;
|
|
68
75
|
|
|
69
76
|
const d = new Date();
|
|
@@ -74,20 +81,23 @@ class Backup {
|
|
|
74
81
|
const f = fs.createWriteStream(name);
|
|
75
82
|
f.on('finish', () => {
|
|
76
83
|
this.debug(`Backup ${name} success`);
|
|
84
|
+
if (callback) callback();
|
|
77
85
|
});
|
|
78
86
|
f.on('error', err => {
|
|
79
87
|
this.error(`Cannot pack backup ${name}: ` + err);
|
|
88
|
+
if (callback) callback();
|
|
80
89
|
});
|
|
81
90
|
try {
|
|
82
91
|
tar.create({gzip: true, p: false, cwd: options.dbDir}, files).pipe(f);
|
|
83
92
|
} catch (err) {
|
|
84
93
|
this.error(`Cannot pack backup ${name}: ` + err);
|
|
94
|
+
if (callback) callback();
|
|
85
95
|
}
|
|
86
96
|
}
|
|
87
97
|
}
|
|
88
98
|
|
|
89
|
-
listBackupsFiles(
|
|
90
|
-
const dir = options.dbDir;
|
|
99
|
+
listBackupsFiles() {
|
|
100
|
+
const dir = this.options.dbDir;
|
|
91
101
|
const result = [];
|
|
92
102
|
|
|
93
103
|
if (fs.existsSync(dir)) {
|
|
@@ -117,14 +127,14 @@ class Backup {
|
|
|
117
127
|
}
|
|
118
128
|
}
|
|
119
129
|
|
|
120
|
-
delBackupsFiles(
|
|
130
|
+
delBackupsFiles(files) {
|
|
121
131
|
const arr = files.length;
|
|
122
132
|
if (arr > 10) {
|
|
123
133
|
this.info('delete old Backup files. keep only last 10');
|
|
124
134
|
}
|
|
125
135
|
|
|
126
136
|
for (let i = 10; i < files.length; i++) {
|
|
127
|
-
const name = options.dbDir + '/' + files[i];
|
|
137
|
+
const name = this.options.dbDir + '/' + files[i];
|
|
128
138
|
try {
|
|
129
139
|
require('fs').unlinkSync(name);
|
|
130
140
|
} catch (error) {
|
|
@@ -134,34 +144,53 @@ class Backup {
|
|
|
134
144
|
}
|
|
135
145
|
|
|
136
146
|
|
|
137
|
-
async listbackups(
|
|
138
|
-
|
|
147
|
+
async listbackups(from, command, message, callback) {
|
|
148
|
+
this.adapter.sendTo(from, command, {files:this.listBackupsFiles()}, callback);
|
|
139
149
|
}
|
|
140
150
|
|
|
141
|
-
async restore(
|
|
142
|
-
|
|
151
|
+
async restore(from, command, msg, callback) {
|
|
152
|
+
const name = msg.name;
|
|
153
|
+
if (name == undefined) {
|
|
154
|
+
this.adapter.sendTo(from, command, {error:`cannot restore from undefined file`}, callback);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
const options = this.options;
|
|
158
|
+
const fn = pathLib.join(options.dbDir, name)
|
|
159
|
+
if (fs.existsSync(fn)) {
|
|
143
160
|
try {
|
|
144
|
-
this.
|
|
145
|
-
|
|
146
|
-
this.callPluginMethod('stop');
|
|
147
|
-
if (this.zbController) {
|
|
148
|
-
await this.zbController.stop();
|
|
149
|
-
}
|
|
161
|
+
this.info('Stopping Zigbee subsystem');
|
|
162
|
+
await this.adapter.testConnect({start:false});
|
|
150
163
|
const tar = require('tar');
|
|
164
|
+
const response = {};
|
|
151
165
|
try {
|
|
152
|
-
|
|
166
|
+
const target = this.options.dbDir;
|
|
167
|
+
tar.extract({file: fn, cwd: target}, async err => {
|
|
153
168
|
if (err) {
|
|
154
|
-
|
|
169
|
+
response.error = `Cannot extract from file ${fn}: ${err}`;
|
|
170
|
+
this.error(response.error);
|
|
155
171
|
} else {
|
|
156
|
-
this.
|
|
172
|
+
this.info(`Extract from file ${fn} success`);
|
|
173
|
+
}
|
|
174
|
+
const result = await this.adapter.testConnect({start:true});
|
|
175
|
+
if (!result.status) {
|
|
176
|
+
const errors = [];
|
|
177
|
+
if (response.error) errors.push(response.error);
|
|
178
|
+
errors.push('unable to start zigbee subsystem.');
|
|
179
|
+
if (result.error) errors.push(result.error);
|
|
180
|
+
errors.push('Please verify the configuration and the restored files');
|
|
181
|
+
response.error = errors.join('\n');
|
|
157
182
|
}
|
|
158
|
-
this.
|
|
183
|
+
this.adapter.sendTo(from, command, response, callback);
|
|
159
184
|
});
|
|
160
185
|
} catch (err) {
|
|
161
|
-
|
|
186
|
+
response.error = `Cannot extrack backup ${name}: ${err?.message || 'no reason given'}`
|
|
187
|
+
this.error(response.error);
|
|
188
|
+
this.adapter.sendTo(from, command, response, callback);
|
|
162
189
|
}
|
|
163
190
|
} catch (error) {
|
|
164
|
-
|
|
191
|
+
const errmsg = `Error stopping the zigbee subsystem: ${error?.message || 'no reason given'}`
|
|
192
|
+
this.error(errmsg);
|
|
193
|
+
this.adapter.sendTo(from, command, {error:errmsg}, callback);
|
|
165
194
|
}
|
|
166
195
|
}
|
|
167
196
|
}
|