iobroker.alarm 2.1.2 → 2.2.1
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/LICENSE +1 -1
- package/README.md +10 -2
- package/admin/index_m.html +35 -1
- package/admin/words.js +32 -2
- package/io-package.json +30 -2
- package/main.js +9 -3
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2019-
|
|
3
|
+
Copyright (c) 2019-2022 misanorot <audi16v@gmx.de>
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
|
|
4
4
|
 [](https://www.npmjs.com/package/iobroker.alarm)
|
|
5
5
|
[](https://www.npmjs.com/package/iobroker.alarm)
|
|
6
|
-
[](https://david-dm.org/misanorot/iobroker.alarm)
|
|
7
6
|
[](https://snyk.io/test/github/misanorot/ioBroker.alarm)
|
|
8
7
|
|
|
9
8
|
[](https://nodei.co/npm/iobroker.alarm/)
|
|
@@ -43,6 +42,8 @@ Hier werden die Einstellungen wie die Zeiten der Nachtruhe, Sirenezeit, Stiller-
|
|
|
43
42
|
Benachrichtigungen über Andere Adapter wie z. B. Telegramm, Email oder andere.
|
|
44
43
|
[Probleme](#Probleme)
|
|
45
44
|
|
|
45
|
+
Bei Benachrichtigungen an den Telegram Adapter, ist es möglich User- oder Chat IDs zu benutzen.
|
|
46
|
+
|
|
46
47
|
----------------------------------------------------------------------------------------------------------------------
|
|
47
48
|
|
|
48
49
|
### Tab Überwachung
|
|
@@ -152,6 +153,13 @@ Beinhaltet die Informationen für die "anderen" Alarmkreise 1 + 2.
|
|
|
152
153
|
|
|
153
154
|
## Changelog
|
|
154
155
|
|
|
156
|
+
|
|
157
|
+
#### 2.2.1 (20.01.2022)
|
|
158
|
+
* (misanorot) added notification when warnings at beginning night rest
|
|
159
|
+
|
|
160
|
+
#### 2.2.0 (16.01.2022)
|
|
161
|
+
* (misanorot) added telegram special parameters
|
|
162
|
+
|
|
155
163
|
#### 2.1.1 (07.11.2021)
|
|
156
164
|
* (misanorot) added countdown state for silent alarm
|
|
157
165
|
|
|
@@ -245,4 +253,4 @@ Beinhaltet die Informationen für die "anderen" Alarmkreise 1 + 2.
|
|
|
245
253
|
## License
|
|
246
254
|
MIT License
|
|
247
255
|
|
|
248
|
-
Copyright (c) 2019-
|
|
256
|
+
Copyright (c) 2019-2022 misanorot <audi16v@gmx.de>
|
package/admin/index_m.html
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
$('.tooltipped').tooltip();
|
|
71
|
-
|
|
71
|
+
telChanging();
|
|
72
72
|
values2table('circuits', circuits, onChange, tableOnReady);
|
|
73
73
|
leaving();
|
|
74
74
|
values2table('shorts_in', shorts_in, onChange, tableOnReady);
|
|
@@ -85,6 +85,8 @@
|
|
|
85
85
|
*/
|
|
86
86
|
$('#opt_leave').change(leaving);
|
|
87
87
|
|
|
88
|
+
$('#opt_telegram').change(telChanging);
|
|
89
|
+
|
|
88
90
|
|
|
89
91
|
$('.sendTo_Chips').chips({
|
|
90
92
|
placeholder: 'Add adapter',
|
|
@@ -187,6 +189,22 @@ function checkTrigger(val, id) {
|
|
|
187
189
|
$('select').select()
|
|
188
190
|
}
|
|
189
191
|
|
|
192
|
+
function telChanging() {
|
|
193
|
+
let check = document.getElementById('opt_telegram').checked;
|
|
194
|
+
|
|
195
|
+
if (check) {
|
|
196
|
+
$('#user').prop('disabled', false);
|
|
197
|
+
$('#chatID').prop('disabled', false);
|
|
198
|
+
$('#user').show();
|
|
199
|
+
$('#chatID').show();
|
|
200
|
+
} else {
|
|
201
|
+
$('#user').prop('disabled', true);
|
|
202
|
+
$('#chatID').prop('disabled', true);
|
|
203
|
+
$('#user').hide();
|
|
204
|
+
$('#chatID').hide();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
190
208
|
function leaving() {
|
|
191
209
|
|
|
192
210
|
let check = document.getElementById('opt_leave').checked;
|
|
@@ -689,6 +707,19 @@ function getName(obj) {
|
|
|
689
707
|
<div class="chips sendTo_Chips"></div>
|
|
690
708
|
</div>
|
|
691
709
|
</div>
|
|
710
|
+
<div class="row">
|
|
711
|
+
<div class="col s12 m4 l2">
|
|
712
|
+
<input type="checkbox" id="opt_telegram" class="value" /><label for="opt_telegram" class="translate">opt_telegram</label>
|
|
713
|
+
</div>
|
|
714
|
+
<div class="input-field col s6 m4 l2">
|
|
715
|
+
<input id="chatID" type="text" class="validate value">
|
|
716
|
+
<label for="chatID">chatID</label>
|
|
717
|
+
</div>
|
|
718
|
+
<div class="input-field col s6 m4 l2">
|
|
719
|
+
<input id="user" type="text" class="validate value">
|
|
720
|
+
<label for="user">user</label>
|
|
721
|
+
</div>
|
|
722
|
+
</div>
|
|
692
723
|
<div class="row">
|
|
693
724
|
<div class="col s12">
|
|
694
725
|
<div class="card-panel">
|
|
@@ -745,6 +776,9 @@ function getName(obj) {
|
|
|
745
776
|
<div class="col s12 m6 l4">
|
|
746
777
|
<input type="checkbox" id="send_notification_changes" class="value" /><label for="send_notification_changes" class="translate">send_notification_changes</label>
|
|
747
778
|
</div>
|
|
779
|
+
<div class="col s12 m6 l4">
|
|
780
|
+
<input type="checkbox" id="send_activation_warnings_night" class="value" /><label for="send_activation_warnings_night" class="translate">send_activation_warnings_night</label>
|
|
781
|
+
</div>
|
|
748
782
|
</div>
|
|
749
783
|
<div class="row">
|
|
750
784
|
<div class="col s12">
|
package/admin/words.js
CHANGED
|
@@ -89,7 +89,16 @@ systemDictionary = {
|
|
|
89
89
|
'night_Chips': { 'en': 'States for night rest circuit', 'de': 'Zustände für die Nachtruhe', 'ru': 'Штаты для ночного отдыха', 'pt': 'Estados para circuito de descanso noturno', 'nl': 'Staten voor nachtrustcircuit', 'fr': 'États pour circuit de nuit', 'it': 'Stati per il circuito di riposo notturno', 'es': 'Estados para el circuito de descanso nocturno.', 'pl': 'Stany na nocny obwód odpoczynku', 'zh-cn': '国家为夜间休息电路'},
|
|
90
90
|
'night_from': { 'en': 'Begins of the night rest', 'de': 'Beginn der Nachtruhe', 'ru': 'Начинается ночной отдых', 'pt': 'Começa do resto da noite', 'nl': 'Begin van de nachtrust', 'fr': 'Commence la nuit repos', 'it': 'Inizia il riposo notturno', 'es': 'Comienzo del descanso nocturno.', 'pl': 'Zaczyna się nocny odpoczynek', 'zh-cn': '开始的夜晚休息'},
|
|
91
91
|
'night_to': { 'en': 'Ends of the night rest', 'de': 'Ende der Nachtruhe', 'ru': 'Концы ночного отдыха', 'pt': 'Termina do resto da noite', 'nl': 'Einde van de nachtrust', 'fr': 'Fin de la nuit repos', 'it': 'Fine del riposo notturno', 'es': 'Finales del descanso nocturno.', 'pl': 'Koniec nocnego odpoczynku', 'zh-cn': '晚上休息'},
|
|
92
|
-
'notification': {
|
|
92
|
+
'notification': {'en': 'notifications (include night rest)',
|
|
93
|
+
'de': 'Benachrichtigungen (einschließlich Nachtruhe)',
|
|
94
|
+
'ru': 'уведомления (включая ночной отдых)',
|
|
95
|
+
'pt': 'notificações (incluindo descanso noturno)',
|
|
96
|
+
'nl': 'notificaties (inclusief nachtrust)',
|
|
97
|
+
'fr': 'notifications (y compris le repos nocturne)',
|
|
98
|
+
'it': 'notifiche (incluso riposo notturno)',
|
|
99
|
+
'es': 'notificaciones (incluye descanso nocturno)',
|
|
100
|
+
'pl': 'powiadomienia (w tym odpoczynek nocny)',
|
|
101
|
+
'zh-cn': '通知(包括夜间休息)'},
|
|
93
102
|
'notifications': { 'en': 'Notifications', 'de': 'Benachrichtigungen', 'ru': 'Уведомления', 'pt': 'Notificações', 'nl': 'Kennisgevingen', 'fr': 'Notifications', 'it': 'notifiche', 'es': 'Notificaciones', 'pl': 'Powiadomienia', 'zh-cn': '通知事项'},
|
|
94
103
|
'opt_leave': { 'en': 'activation at leaving during countdown',
|
|
95
104
|
'de': 'Aktivierung beim Verlassen während des Countdowns',
|
|
@@ -128,6 +137,17 @@ systemDictionary = {
|
|
|
128
137
|
'opt_say_night': { 'en': "Warnings at the beginning of the night's rest", 'de': 'Warnungen zu Beginn der Nachtruhe', 'ru': 'Предупреждения в начале ночного отдыха', 'pt': 'Advertências no início do resto da noite', 'nl': 'Waarschuwingen aan het begin van de nachtrust', 'fr': 'Avertissements au début du repos nocturne', 'it': "Avvertenze all'inizio del riposo notturno", 'es': 'Advertencias al comienzo del descanso nocturno.', 'pl': 'Ostrzeżenia na początku nocnego odpoczynku', 'zh-cn': '夜间休息开始时的警告'},
|
|
129
138
|
'opt_say_warn': { 'en': 'Warnings at the beginning of the warn circuit activate', 'de': 'Warnungen zu Beginn der Warnkreis Aktivierung', 'ru': 'Предупреждения в начале ночного отдыха', 'pt': 'Advertências no início do resto da noite', 'nl': 'Waarschuwingen aan het begin van de nachtrust', 'fr': 'Avertissements au début du repos nocturne', 'it': "Avvertenze all'inizio del riposo notturno", 'es': 'Advertencias al comienzo del descanso nocturno.', 'pl': 'Ostrzeżenia na początku nocnego odpoczynku', 'zh-cn': '夜间休息开始时的警告'},
|
|
130
139
|
'opt_say_warn_changes': { 'en': 'Changes during sharp inside', 'de': 'Veränderungen während SCHARF INTERN', 'ru': 'Изменения во время ночного отдыха и резких внутри', 'pt': 'Alterações durante o descanso noturno e nítidas por dentro', 'nl': 'Veranderingen tijdens nachtrust en scherp van binnen', 'fr': 'Changements pendant le repos nocturne et intérieur vif', 'it': "Cambiamenti durante il riposo notturno e taglienti all'interno", 'es': 'Cambios durante el descanso nocturno y agudo por dentro', 'pl': 'Zmiany podczas nocnego odpoczynku i ostre wnętrze', 'zh-cn': '夜间休息时变化多端,内部锐利'},
|
|
140
|
+
'opt_telegram': {'en': 'special parameters for Telegram',
|
|
141
|
+
'de': 'spezielle Parameter für Telegram',
|
|
142
|
+
'ru': 'специальные параметры для Telegram',
|
|
143
|
+
'pt': 'parâmetros especiais para Telegram',
|
|
144
|
+
'nl': 'speciale parameters voor Telegram',
|
|
145
|
+
'fr': 'paramètres spéciaux pour Telegram',
|
|
146
|
+
'it': 'parametri speciali per Telegram',
|
|
147
|
+
'es': 'parámetros especiales para Telegram',
|
|
148
|
+
'pl': 'specjalne parametry dla Telegrama',
|
|
149
|
+
'zh-cn': '电报的特殊参数'},
|
|
150
|
+
|
|
131
151
|
'opt_warning': { 'en': 'Ignore configured states at activation', 'de': 'Konfigurierte Zustände bei der Aktivierung ignorieren', 'ru': 'Игнорировать настроенные состояния предупреждения при активации', 'pt': 'Ignore os estados de aviso configurados na ativação', 'nl': 'Negeer geconfigureerde waarschuwingsstatussen bij activering', 'fr': "Ignorer les états d'avertissement configurés lors de l'activation", 'it': "Ignora gli stati di avviso configurati all'attivazione", 'es': 'Ignorar los estados de advertencia configurados en la activación', 'pl': 'Zignoruj skonfigurowane stany ostrzeżeń przy aktywacji', 'zh-cn': '激活时忽略已配置的警告状态'},
|
|
132
152
|
'other_alarms': {'en': 'other alarms',
|
|
133
153
|
'de': 'andere Alarme',
|
|
@@ -187,7 +207,7 @@ systemDictionary = {
|
|
|
187
207
|
'pl': 'Aktywowany z ostrzeżeniami',
|
|
188
208
|
'zh-cn': '警告激活'},
|
|
189
209
|
'send_activation_warnings': { 'en': 'Notification if warnings upon activation',
|
|
190
|
-
'de': 'Benachrichtigung
|
|
210
|
+
'de': 'Benachrichtigung falls Warnungen bei Aktivierung',
|
|
191
211
|
'ru': 'Уведомление, если предупреждения при активации',
|
|
192
212
|
'pt': 'Notificação se houver avisos na ativação',
|
|
193
213
|
'nl': 'Melding als waarschuwingen bij activering',
|
|
@@ -196,6 +216,16 @@ systemDictionary = {
|
|
|
196
216
|
'es': 'Notificación de advertencias sobre la activación',
|
|
197
217
|
'pl': 'Powiadomienie o ostrzeżeniach po aktywacji',
|
|
198
218
|
'zh-cn': '激活时发出警告通知'},
|
|
219
|
+
'send_activation_warnings_night': {'en': 'notification when warnings at beginning night rest',
|
|
220
|
+
'de': 'Benachrichtigung bei Warnungen zu Beginn der Nachtruhe',
|
|
221
|
+
'ru': 'уведомление при предупреждениях о начале ночного отдыха',
|
|
222
|
+
'pt': 'notificação quando avisos no início do descanso noturno',
|
|
223
|
+
'nl': 'melding bij waarschuwingen bij het begin van de nachtrust',
|
|
224
|
+
'fr': 'notification lors des avertissements au début du repos nocturne',
|
|
225
|
+
'it': "notifica quando avvisi all'inizio del riposo notturno",
|
|
226
|
+
'es': 'notificación cuando avisos al inicio del descanso nocturno',
|
|
227
|
+
'pl': 'powiadomienie o ostrzeżeniach na początku odpoczynku nocnego',
|
|
228
|
+
'zh-cn': '在开始夜间休息时发出警告时的通知' },
|
|
199
229
|
'send_failed': {
|
|
200
230
|
'en': 'wrong password',
|
|
201
231
|
'de': 'falsches Passwort',
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "alarm",
|
|
4
|
-
"version": "2.1
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"news": {
|
|
6
|
+
"2.2.1": {
|
|
7
|
+
"en": "added notification when warnings at beginning night rest",
|
|
8
|
+
"de": "Benachrichtigung bei Warnungen zu Beginn der Nachtruhe hinzugefügt",
|
|
9
|
+
"ru": "добавлено уведомление при предупреждениях при начале ночного отдыха",
|
|
10
|
+
"pt": "adicionada notificação quando avisos no início do descanso noturno",
|
|
11
|
+
"nl": "melding toegevoegd bij waarschuwingen bij het begin van de nachtrust",
|
|
12
|
+
"fr": "ajout d'une notification lors des avertissements au début du repos nocturne",
|
|
13
|
+
"it": "aggiunta notifica quando avverte all'inizio del riposo notturno",
|
|
14
|
+
"es": "notificación agregada cuando las advertencias al comienzo del descanso nocturno",
|
|
15
|
+
"pl": "dodano powiadomienie, gdy ostrzeżenia o rozpoczęciu nocnego odpoczynku",
|
|
16
|
+
"zh-cn": "在开始夜间休息时发出警告时添加通知"
|
|
17
|
+
},
|
|
18
|
+
"2.2.0": {
|
|
19
|
+
"en": "added telegram special parameters",
|
|
20
|
+
"de": "spezielle Telegrammparameter hinzugefügt",
|
|
21
|
+
"ru": "добавлены специальные параметры телеграммы",
|
|
22
|
+
"pt": "parâmetros especiais de telegrama adicionados",
|
|
23
|
+
"nl": "toegevoegde telegram speciale parameters",
|
|
24
|
+
"fr": "paramètres spéciaux de télégramme ajoutés",
|
|
25
|
+
"it": "aggiunti parametri speciali del telegramma",
|
|
26
|
+
"es": "parámetros especiales de telegrama agregados",
|
|
27
|
+
"pl": "dodano parametry specjalne telegramu",
|
|
28
|
+
"zh-cn": "添加电报特殊参数"
|
|
29
|
+
},
|
|
6
30
|
"2.1.2": {
|
|
7
31
|
"en": "fixed \"colors\" vulnerabilities",
|
|
8
32
|
"de": "\"Farben\"-Schwachstellen behoben",
|
|
@@ -168,6 +192,7 @@
|
|
|
168
192
|
"send_activation_inside": false,
|
|
169
193
|
"send_activation_warnings": true,
|
|
170
194
|
"send_activation_warnings_inside": true,
|
|
195
|
+
"send_activation_warnings_night": true,
|
|
171
196
|
"send_activated_with_warnings": true,
|
|
172
197
|
"send_alarm_silent": true,
|
|
173
198
|
"send_failed": true,
|
|
@@ -212,7 +237,10 @@
|
|
|
212
237
|
"log_one": "Alarmanlage meldet einen Feueralarm:",
|
|
213
238
|
"log_two": "Alarmanlage meldet einen Wasseralarm:",
|
|
214
239
|
"one_name": "Feueralarm",
|
|
215
|
-
"two_name": "Wasseralarm"
|
|
240
|
+
"two_name": "Wasseralarm",
|
|
241
|
+
"opt_telegram": false,
|
|
242
|
+
"chatID": "",
|
|
243
|
+
"user": ""
|
|
216
244
|
},
|
|
217
245
|
"objects": [],
|
|
218
246
|
"instanceObjects": [
|
package/main.js
CHANGED
|
@@ -858,9 +858,15 @@ function set_subs(){
|
|
|
858
858
|
|
|
859
859
|
function messages(content){
|
|
860
860
|
if(send_instances.length){
|
|
861
|
+
const reg = new RegExp('telegram');
|
|
861
862
|
send_instances.forEach((ele)=>{
|
|
862
|
-
|
|
863
|
-
|
|
863
|
+
if (reg.test(ele) && A.opt_telegram) {
|
|
864
|
+
adapter.log.debug(`Send message to ${ele} with special parameter, message: text: ${content}, user: ${A.user}, chatID: ${A.chatID}`);
|
|
865
|
+
adapter.sendTo(ele, 'send', {'text':content, 'user': A.user, 'chatId': A.chatID});
|
|
866
|
+
} else {
|
|
867
|
+
adapter.log.debug(`Send message to ${ele}, message: ${content}`);
|
|
868
|
+
adapter.sendTo(ele, {'text':content});
|
|
869
|
+
}
|
|
864
870
|
});
|
|
865
871
|
}
|
|
866
872
|
}
|
|
@@ -1105,7 +1111,7 @@ function sleep_begin(auto) {
|
|
|
1105
1111
|
adapter.setState('use.list', 4, true);
|
|
1106
1112
|
if(is_notification){
|
|
1107
1113
|
let say = A.text_warning;
|
|
1108
|
-
|
|
1114
|
+
if(A.send_activation_warnings_night) messages(`${A.log_nights_b_w} ${names_notification}`);
|
|
1109
1115
|
adapter.setState('info.log', `${A.log_nights_b_w} ${names_notification}`, true);
|
|
1110
1116
|
if(log) adapter.log.info(`${A.log_nights_b_w} ${names_notification}`);
|
|
1111
1117
|
if(A.opt_say_names){
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_from": "github:misanorot/ioBroker.alarm",
|
|
3
|
-
"_id": "iobroker.alarm@2.1
|
|
3
|
+
"_id": "iobroker.alarm@2.2.1",
|
|
4
4
|
"_inBundle": false,
|
|
5
5
|
"_integrity": "",
|
|
6
6
|
"_location": "/iobroker.alarm",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"#USER",
|
|
23
23
|
"/"
|
|
24
24
|
],
|
|
25
|
-
"_resolved": "github:misanorot/ioBroker.alarm#
|
|
25
|
+
"_resolved": "github:misanorot/ioBroker.alarm#e8fde8b26f79d8a149e5fba89040a27bce9dcf1e",
|
|
26
26
|
"_spec": "misanorot/ioBroker.alarm",
|
|
27
27
|
"_where": "/opt/iobroker",
|
|
28
28
|
"author": {
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"test:package": "mocha test/package --exit",
|
|
81
81
|
"test:unit": "mocha test/unit --exit"
|
|
82
82
|
},
|
|
83
|
-
"version": "2.1
|
|
83
|
+
"version": "2.2.1"
|
|
84
84
|
}
|