iobroker.lorawan 1.18.33 → 1.18.35
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 +6 -0
- package/admin/i18n/de/translations.json +2 -2
- package/io-package.json +27 -27
- package/lib/modules/bridge.js +49 -53
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,6 +23,12 @@ For now there is documentation in English here: https://wiki.hafenmeister.de
|
|
|
23
23
|
Placeholder for the next version (at the beginning of the line):
|
|
24
24
|
### **WORK IN PROGRESS**
|
|
25
25
|
-->
|
|
26
|
+
### 1.18.35 (2025-11-28)
|
|
27
|
+
* (BenAhrdt) internal code improovment for better reading
|
|
28
|
+
|
|
29
|
+
### 1.18.34 (2025-11-28)
|
|
30
|
+
* (BenAhrdt) translation changed
|
|
31
|
+
|
|
26
32
|
### 1.18.33 (2025-11-28)
|
|
27
33
|
* (BenAhrdt) change state in Lock entity
|
|
28
34
|
|
|
@@ -88,8 +88,8 @@
|
|
|
88
88
|
"LoRaWAN Network Service is disconnected": "Der Lorawan Netzwerkdienst ist getrennt",
|
|
89
89
|
"LoRaWAN device is back online": "Folgendes Lorawan Gerät ist wieder online",
|
|
90
90
|
"LoRaWAN device is offline": "Folgendes Lorawan Gerät ist offline",
|
|
91
|
-
"LockHeader": "Definieren Sie Zustände für eine
|
|
92
|
-
"LockInformation": "Hier können Sie ein Array von
|
|
91
|
+
"LockHeader": "Definieren Sie Zustände für eine Lock-Entität",
|
|
92
|
+
"LockInformation": "Hier können Sie ein Array von Lockdefinitionen definieren",
|
|
93
93
|
"LockLockText": "Verriegeln Id",
|
|
94
94
|
"LockNameText": "Entitätsname",
|
|
95
95
|
"LockOpen": "offen",
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "lorawan",
|
|
4
|
-
"version": "1.18.
|
|
4
|
+
"version": "1.18.35",
|
|
5
5
|
"news": {
|
|
6
|
+
"1.18.35": {
|
|
7
|
+
"en": "internal code improovment for better reading",
|
|
8
|
+
"de": "interner code improovement für besseres lesen",
|
|
9
|
+
"ru": "импровизация внутреннего кода для лучшего чтения",
|
|
10
|
+
"pt": "improvisação de código interno para melhor leitura",
|
|
11
|
+
"nl": "interne code improvisatie voor beter lezen",
|
|
12
|
+
"fr": "imprégnation du code interne pour une meilleure lecture",
|
|
13
|
+
"it": "codice interno improovment per una migliore lettura",
|
|
14
|
+
"es": "improvimento de código interno para una mejor lectura",
|
|
15
|
+
"pl": "improwizacja kodu wewnętrznego dla lepszego czytania",
|
|
16
|
+
"uk": "внутрішня обробка коду для кращого читання",
|
|
17
|
+
"zh-cn": "内部代码即兴读取"
|
|
18
|
+
},
|
|
19
|
+
"1.18.34": {
|
|
20
|
+
"en": "translation changed",
|
|
21
|
+
"de": "übersetzung geändert",
|
|
22
|
+
"ru": "перевод изменился",
|
|
23
|
+
"pt": "tradução alterada",
|
|
24
|
+
"nl": "vertaling gewijzigd",
|
|
25
|
+
"fr": "traduction changée",
|
|
26
|
+
"it": "traduzione cambiata",
|
|
27
|
+
"es": "traducción modificada",
|
|
28
|
+
"pl": "zmienione tłumaczenie",
|
|
29
|
+
"uk": "зміни перекладу",
|
|
30
|
+
"zh-cn": "翻译更改"
|
|
31
|
+
},
|
|
6
32
|
"1.18.33": {
|
|
7
33
|
"en": "change state in Lock entity",
|
|
8
34
|
"de": "änderungszustand in Sperreinrichtung",
|
|
@@ -67,32 +93,6 @@
|
|
|
67
93
|
"pl": "set ack = true, przed push data Giełda",
|
|
68
94
|
"uk": "встановити ack = true, перш ніж натиснути дані Обмін",
|
|
69
95
|
"zh-cn": "在按下数据前设置 ack = true 交换"
|
|
70
|
-
},
|
|
71
|
-
"1.18.28": {
|
|
72
|
-
"en": "assign comment 'from bridge' to state, if the value is set by bridge",
|
|
73
|
-
"de": "kommentar 'von der brücke' zum zustand zuordnen, wenn der wert von der brücke gesetzt wird",
|
|
74
|
-
"ru": "присвоить комментарий «от моста» государству, если значение установлено мостом",
|
|
75
|
-
"pt": "atribuir o comentário 'da ponte' ao estado, se o valor for definido pela ponte",
|
|
76
|
-
"nl": "commentaar 'van brug' toewijzen aan status, als de waarde door brug wordt ingesteld",
|
|
77
|
-
"fr": "assigner le commentaire 'from bridge' à l'état, si la valeur est définie par bridge",
|
|
78
|
-
"it": "assegnare commento 'da ponte' a stato, se il valore è impostato da ponte",
|
|
79
|
-
"es": "asignar comentario 'de puente' a estado, si el valor se establece por puente",
|
|
80
|
-
"pl": "przypisz komentarz \"z mostu\" do stanu, jeśli wartość jest ustawiona przez most",
|
|
81
|
-
"uk": "призначте коментар «з місту» до держави, якщо значення встановлене містом",
|
|
82
|
-
"zh-cn": "如果值由桥来设定, 则将注释“ 从桥” 指定为状态"
|
|
83
|
-
},
|
|
84
|
-
"1.18.27": {
|
|
85
|
-
"en": "wright incomming dataexchange with ack = true",
|
|
86
|
-
"de": "wright incoming dataexchange mit ack = true",
|
|
87
|
-
"ru": "wright incomming dataexchange with ack = истинное",
|
|
88
|
-
"pt": "wright incomming datachange with ack = true",
|
|
89
|
-
"nl": "wright incoming dataexchange with ack = true",
|
|
90
|
-
"fr": "wright avec l'échange de données avec ack = true",
|
|
91
|
-
"it": "wright incomming dataexchange con ack = true",
|
|
92
|
-
"es": "wright incomming dataexchange con ack = verdadero",
|
|
93
|
-
"pl": "wright incomming datachange with ack = true",
|
|
94
|
-
"uk": "wright incomming dataexchange with ack = true",
|
|
95
|
-
"zh-cn": "wright 以 ack = true 输入数据交换"
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"titleLang": {
|
package/lib/modules/bridge.js
CHANGED
|
@@ -221,6 +221,8 @@ class bridgeClass {
|
|
|
221
221
|
await this.publishId(this.SubscribedTopics[topic].id, message, {});
|
|
222
222
|
return;
|
|
223
223
|
}
|
|
224
|
+
|
|
225
|
+
// Light
|
|
224
226
|
if (this.SubscribedTopics[topic].light) {
|
|
225
227
|
if (message.state) {
|
|
226
228
|
message.state = message.state === 'ON' ? true : false;
|
|
@@ -253,6 +255,8 @@ class bridgeClass {
|
|
|
253
255
|
}
|
|
254
256
|
return;
|
|
255
257
|
}
|
|
258
|
+
|
|
259
|
+
// Cover
|
|
256
260
|
if (this.SubscribedTopics[topic].cover) {
|
|
257
261
|
if (this.SubscribedTopics[topic].messageAssign) {
|
|
258
262
|
if (this.SubscribedTopics[topic].messageAssign[message]) {
|
|
@@ -265,6 +269,8 @@ class bridgeClass {
|
|
|
265
269
|
}
|
|
266
270
|
}
|
|
267
271
|
}
|
|
272
|
+
|
|
273
|
+
// Lock
|
|
268
274
|
if (this.SubscribedTopics[topic].lock) {
|
|
269
275
|
if (this.SubscribedTopics[topic].messageAssign) {
|
|
270
276
|
if (this.SubscribedTopics[topic].messageAssign[message]) {
|
|
@@ -280,6 +286,7 @@ class bridgeClass {
|
|
|
280
286
|
|
|
281
287
|
// Check for namespace and write own, oder foreign state
|
|
282
288
|
if (this.SubscribedTopics[topic].id.startsWith(this.adapter.namespace)) {
|
|
289
|
+
// Special DataExchange
|
|
283
290
|
if (this.SubscribedTopics[topic].dataExchange) {
|
|
284
291
|
if (typeof message === 'object') {
|
|
285
292
|
message = JSON.stringify(message);
|
|
@@ -289,15 +296,19 @@ class bridgeClass {
|
|
|
289
296
|
{ val: message, c: 'from bridge' },
|
|
290
297
|
true,
|
|
291
298
|
);
|
|
299
|
+
// All Adapter internal States
|
|
292
300
|
} else {
|
|
293
301
|
await this.adapter.setState(this.SubscribedTopics[topic].id, {
|
|
294
302
|
val: message,
|
|
295
303
|
c: 'from bridge',
|
|
296
304
|
});
|
|
297
305
|
}
|
|
306
|
+
// Foreign States
|
|
298
307
|
} else {
|
|
308
|
+
// Assignable Topics => id & val
|
|
299
309
|
if (this.SubscribedTopics[topic].messageAssign) {
|
|
300
310
|
await this.adapter.setForeignStateAsync(message.id, { val: message.val, c: 'from bridge' });
|
|
311
|
+
// Write in the desired id
|
|
301
312
|
} else {
|
|
302
313
|
await this.adapter.setForeignStateAsync(this.SubscribedTopics[topic].id, {
|
|
303
314
|
val: message,
|
|
@@ -795,59 +806,49 @@ class bridgeClass {
|
|
|
795
806
|
}
|
|
796
807
|
|
|
797
808
|
// Iterate the state_topics
|
|
798
|
-
for (const
|
|
799
|
-
|
|
809
|
+
for (const element in this.PublishedIds[id].publish) {
|
|
810
|
+
const topic = element;
|
|
811
|
+
const publish = this.PublishedIds[id].publish[element];
|
|
812
|
+
|
|
813
|
+
// Light
|
|
814
|
+
if (publish.light) {
|
|
800
815
|
val = {};
|
|
801
|
-
val.state = (
|
|
802
|
-
await this.adapter.getForeignStateAsync(
|
|
803
|
-
this.PublishedIds[id].publish[publishTopic].LightIds.onOff,
|
|
804
|
-
)
|
|
805
|
-
).val;
|
|
816
|
+
val.state = (await this.adapter.getForeignStateAsync(publish.LightIds.onOff)).val;
|
|
806
817
|
val.state = val.state === true ? 'ON' : 'OFF';
|
|
807
|
-
if (
|
|
808
|
-
val.brightness = (
|
|
809
|
-
await this.adapter.getForeignStateAsync(
|
|
810
|
-
this.PublishedIds[id].publish[publishTopic].LightIds.brightness,
|
|
811
|
-
)
|
|
812
|
-
).val;
|
|
818
|
+
if (publish.LightIds.brightness) {
|
|
819
|
+
val.brightness = (await this.adapter.getForeignStateAsync(publish.LightIds.brightness)).val;
|
|
813
820
|
}
|
|
814
|
-
if (
|
|
821
|
+
if (publish.LightIds.color) {
|
|
815
822
|
val.color_mode = 'rgb';
|
|
816
823
|
val.color = this.hexToRgb(
|
|
817
|
-
(
|
|
818
|
-
await this.adapter.getForeignStateAsync(
|
|
819
|
-
this.PublishedIds[id].publish[publishTopic].LightIds.color,
|
|
820
|
-
)
|
|
821
|
-
).val,
|
|
824
|
+
(await this.adapter.getForeignStateAsync(publish.LightIds.color)).val,
|
|
822
825
|
);
|
|
823
826
|
}
|
|
824
|
-
if (
|
|
825
|
-
const effect = (
|
|
826
|
-
await this.adapter.getForeignStateAsync(
|
|
827
|
-
this.PublishedIds[id].publish[publishTopic].LightIds.effects,
|
|
828
|
-
)
|
|
829
|
-
).val;
|
|
827
|
+
if (publish.LightIds.effects) {
|
|
828
|
+
const effect = (await this.adapter.getForeignStateAsync(publish.LightIds.effects)).val;
|
|
830
829
|
val.effect = '';
|
|
831
|
-
if (
|
|
832
|
-
val.effect =
|
|
830
|
+
if (publish.effects[effect]) {
|
|
831
|
+
val.effect = publish.effects[effect];
|
|
833
832
|
}
|
|
834
833
|
}
|
|
835
834
|
}
|
|
836
835
|
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
836
|
+
// Cover
|
|
837
|
+
if (publish.cover) {
|
|
838
|
+
if (publish.messageAssign) {
|
|
839
|
+
if (publish.messageAssign[val]) {
|
|
840
|
+
val = publish.messageAssign[val];
|
|
841
841
|
} else {
|
|
842
842
|
return;
|
|
843
843
|
}
|
|
844
844
|
}
|
|
845
845
|
}
|
|
846
846
|
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
847
|
+
// Lock
|
|
848
|
+
if (publish.lock) {
|
|
849
|
+
if (publish.messageAssign) {
|
|
850
|
+
if (publish.messageAssign[val]) {
|
|
851
|
+
val = publish.messageAssign[val];
|
|
851
852
|
} else {
|
|
852
853
|
return;
|
|
853
854
|
}
|
|
@@ -855,23 +856,21 @@ class bridgeClass {
|
|
|
855
856
|
}
|
|
856
857
|
|
|
857
858
|
// safe old values (5 last values)
|
|
858
|
-
if (
|
|
859
|
-
if (!
|
|
860
|
-
|
|
859
|
+
if (publish.values) {
|
|
860
|
+
if (!publish.oldValues) {
|
|
861
|
+
publish.oldValues = [];
|
|
861
862
|
}
|
|
862
|
-
if (
|
|
863
|
-
|
|
863
|
+
if (publish.oldValues.length >= this.MaxValueCount) {
|
|
864
|
+
publish.oldValues.pop();
|
|
864
865
|
}
|
|
865
|
-
|
|
866
|
-
structuredClone(this.PublishedIds[id].publish[publishTopic].values),
|
|
867
|
-
);
|
|
866
|
+
publish.oldValues.unshift(structuredClone(publish.values));
|
|
868
867
|
}
|
|
869
|
-
if (!
|
|
870
|
-
|
|
868
|
+
if (!publish.values) {
|
|
869
|
+
publish.values = {};
|
|
871
870
|
}
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
871
|
+
publish.values.val = val;
|
|
872
|
+
publish.values.ts = Date.now();
|
|
873
|
+
publish.values.time = new Date(Date.now()).toLocaleString(
|
|
875
874
|
this.Timeoutput.Argument,
|
|
876
875
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
877
876
|
// @ts-expect-error
|
|
@@ -885,7 +884,7 @@ class bridgeClass {
|
|
|
885
884
|
} else if (options.retain === undefined) {
|
|
886
885
|
options.retain = true;
|
|
887
886
|
}
|
|
888
|
-
await this.bridgeMqttClient.publish(
|
|
887
|
+
await this.bridgeMqttClient.publish(topic, val, options);
|
|
889
888
|
await this.adapter.setState('info.publishedIds', JSON.stringify(this.PublishedIds), true);
|
|
890
889
|
}
|
|
891
890
|
|
|
@@ -1310,10 +1309,7 @@ class bridgeClass {
|
|
|
1310
1309
|
if (!this.oldDiscoveredDevices[normalizedDeficeIdentifier]) {
|
|
1311
1310
|
// Only messegae with ne fiscovered dewvice, if not in old discovered devices
|
|
1312
1311
|
returnValue.newDevice = DiscoveryObject;
|
|
1313
|
-
let device =
|
|
1314
|
-
DiscoveryObject.informations.usedDeviceId ??
|
|
1315
|
-
DiscoveryObject.informations[0]?.usedDeviceId ??
|
|
1316
|
-
'unknown';
|
|
1312
|
+
let device = DiscoveryObject.payload.device.name;
|
|
1317
1313
|
let message = `${this.adapter.i18nTranslation['new device discovered']}.\n${this.adapter.i18nTranslation['Device']}: ${device}`;
|
|
1318
1314
|
if (DiscoveryObject.informations.usedApplicationName) {
|
|
1319
1315
|
const application = DiscoveryObject.informations.usedApplicationName;
|