iobroker.device-watcher 0.0.6
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 +21 -0
- package/README.md +87 -0
- package/admin/device-watcher.png +0 -0
- package/admin/i18n/de/translations.json +41 -0
- package/admin/i18n/en/translations.json +43 -0
- package/admin/i18n/es/translations.json +49 -0
- package/admin/i18n/fr/translations.json +49 -0
- package/admin/i18n/it/translations.json +49 -0
- package/admin/i18n/nl/translations.json +49 -0
- package/admin/i18n/pl/translations.json +49 -0
- package/admin/i18n/pt/translations.json +49 -0
- package/admin/i18n/ru/translations.json +49 -0
- package/admin/i18n/zh-cn/translations.json +49 -0
- package/admin/images/add_blacklist.png +0 -0
- package/admin/images/list1.png +0 -0
- package/admin/images/list2.png +0 -0
- package/admin/images/list3.png +0 -0
- package/admin/index_m.html +95 -0
- package/admin/jsonConfig.json +310 -0
- package/admin/style.css +32 -0
- package/admin/words.js +47 -0
- package/io-package.json +311 -0
- package/lib/adapter-config.d.ts +19 -0
- package/main.js +582 -0
- package/package.json +69 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<!-- Load ioBroker scripts and styles-->
|
|
6
|
+
<link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
|
|
7
|
+
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">
|
|
8
|
+
|
|
9
|
+
<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
|
|
10
|
+
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>
|
|
11
|
+
|
|
12
|
+
<script type="text/javascript" src="../../js/translate.js"></script>
|
|
13
|
+
<script type="text/javascript" src="../../lib/js/materialize.js"></script>
|
|
14
|
+
<script type="text/javascript" src="../../js/adapter-settings.js"></script>
|
|
15
|
+
|
|
16
|
+
<!-- Load our own files -->
|
|
17
|
+
<link rel="stylesheet" type="text/css" href="style.css" />
|
|
18
|
+
<script type="text/javascript" src="words.js"></script>
|
|
19
|
+
|
|
20
|
+
<script type="text/javascript">
|
|
21
|
+
// This will be called by the admin adapter when the settings page loads
|
|
22
|
+
function load(settings, onChange) {
|
|
23
|
+
// example: select elements with id=key and class=value and insert value
|
|
24
|
+
if (!settings) return;
|
|
25
|
+
$('.value').each(function () {
|
|
26
|
+
var $key = $(this);
|
|
27
|
+
var id = $key.attr('id');
|
|
28
|
+
if ($key.attr('type') === 'checkbox') {
|
|
29
|
+
// do not call onChange direct, because onChange could expect some arguments
|
|
30
|
+
$key.prop('checked', settings[id])
|
|
31
|
+
.on('change', () => onChange())
|
|
32
|
+
;
|
|
33
|
+
} else {
|
|
34
|
+
// do not call onChange direct, because onChange could expect some arguments
|
|
35
|
+
$key.val(settings[id])
|
|
36
|
+
.on('change', () => onChange())
|
|
37
|
+
.on('keyup', () => onChange())
|
|
38
|
+
;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
onChange(false);
|
|
42
|
+
// reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
|
|
43
|
+
if (M) M.updateTextFields();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// This will be called by the admin adapter when the user presses the save button
|
|
47
|
+
function save(callback) {
|
|
48
|
+
// example: select elements with class=value and build settings object
|
|
49
|
+
var obj = {};
|
|
50
|
+
$('.value').each(function () {
|
|
51
|
+
var $this = $(this);
|
|
52
|
+
if ($this.attr('type') === 'checkbox') {
|
|
53
|
+
obj[$this.attr('id')] = $this.prop('checked');
|
|
54
|
+
} else if ($this.attr('type') === 'number') {
|
|
55
|
+
obj[$this.attr('id')] = parseFloat($this.val());
|
|
56
|
+
} else {
|
|
57
|
+
obj[$this.attr('id')] = $this.val();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
callback(obj);
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
</head>
|
|
65
|
+
|
|
66
|
+
<body>
|
|
67
|
+
|
|
68
|
+
<div class="m adapter-container">
|
|
69
|
+
|
|
70
|
+
<div class="row">
|
|
71
|
+
<div class="col s12 m4 l2">
|
|
72
|
+
<img src="device-watcher.png" class="logo">
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<!-- Put your content here -->
|
|
77
|
+
|
|
78
|
+
<!-- For example columns with settings: -->
|
|
79
|
+
<div class="row">
|
|
80
|
+
<div class="col s6 input-field">
|
|
81
|
+
<input type="checkbox" class="value" id="option1" />
|
|
82
|
+
<label for="option1" class="translate">option1</label>
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div class="col s6 input-field">
|
|
86
|
+
<input type="text" class="value" id="option2" />
|
|
87
|
+
<label for="option2" class="translate">option2</label>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
</body>
|
|
94
|
+
|
|
95
|
+
</html>
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
{
|
|
2
|
+
"i18n": true,
|
|
3
|
+
"type": "tabs",
|
|
4
|
+
"items": {
|
|
5
|
+
"_options": {
|
|
6
|
+
"type": "panel",
|
|
7
|
+
"label": "Options",
|
|
8
|
+
"items": {
|
|
9
|
+
"_headerDevices": {
|
|
10
|
+
"type": "header",
|
|
11
|
+
"text": "Choose devices to watch",
|
|
12
|
+
"size": 1
|
|
13
|
+
},
|
|
14
|
+
"zigbeeDevices": {
|
|
15
|
+
"type": "checkbox",
|
|
16
|
+
"sm": 12,
|
|
17
|
+
"md": 6,
|
|
18
|
+
"lg": 3,
|
|
19
|
+
"label": "Zigbee"
|
|
20
|
+
},
|
|
21
|
+
"bleDevices": {
|
|
22
|
+
"type": "checkbox",
|
|
23
|
+
"sm": 12,
|
|
24
|
+
"md": 6,
|
|
25
|
+
"lg": 3,
|
|
26
|
+
"label": "Ble"
|
|
27
|
+
},
|
|
28
|
+
"sonoffDevices": {
|
|
29
|
+
"type": "checkbox",
|
|
30
|
+
"sm": 12,
|
|
31
|
+
"md": 6,
|
|
32
|
+
"lg": 3,
|
|
33
|
+
"label": "Sonoff"
|
|
34
|
+
},
|
|
35
|
+
"shellyDevices": {
|
|
36
|
+
"type": "checkbox",
|
|
37
|
+
"sm": 12,
|
|
38
|
+
"md": 6,
|
|
39
|
+
"lg": 3,
|
|
40
|
+
"label": "Shelly"
|
|
41
|
+
},
|
|
42
|
+
"homematicDevices": {
|
|
43
|
+
"type": "checkbox",
|
|
44
|
+
"sm": 12,
|
|
45
|
+
"md": 6,
|
|
46
|
+
"lg": 3,
|
|
47
|
+
"label": "Homematic"
|
|
48
|
+
},
|
|
49
|
+
"deconzDevices": {
|
|
50
|
+
"type": "checkbox",
|
|
51
|
+
"sm": 12,
|
|
52
|
+
"md": 6,
|
|
53
|
+
"lg": 3,
|
|
54
|
+
"label": "Deconz"
|
|
55
|
+
},
|
|
56
|
+
"zwaveDevices": {
|
|
57
|
+
"type": "checkbox",
|
|
58
|
+
"sm": 12,
|
|
59
|
+
"md": 6,
|
|
60
|
+
"lg": 3,
|
|
61
|
+
"label": "Zwave"
|
|
62
|
+
},
|
|
63
|
+
"_headerOtherSettings": {
|
|
64
|
+
"type": "header",
|
|
65
|
+
"text": "Other Settings",
|
|
66
|
+
"size": 1
|
|
67
|
+
},
|
|
68
|
+
"trueState": {
|
|
69
|
+
"newLine": true,
|
|
70
|
+
"type": "checkbox",
|
|
71
|
+
"sm": 12,
|
|
72
|
+
"md": 6,
|
|
73
|
+
"lg": 4,
|
|
74
|
+
"label": "True State",
|
|
75
|
+
"help": "Use the true state from quality state"
|
|
76
|
+
},
|
|
77
|
+
"maxMinutes": {
|
|
78
|
+
"type": "number",
|
|
79
|
+
"min": 0,
|
|
80
|
+
"max": 100000,
|
|
81
|
+
"sm": 12,
|
|
82
|
+
"md": 6,
|
|
83
|
+
"lg": 4,
|
|
84
|
+
"label": "Offline time of Devices",
|
|
85
|
+
"help": "in minutes"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"_notifications": {
|
|
90
|
+
"type": "panel",
|
|
91
|
+
"label": "Notifications",
|
|
92
|
+
"items": {
|
|
93
|
+
"_headerCommon": {
|
|
94
|
+
"type":"header",
|
|
95
|
+
"text":"Common Notification Settings",
|
|
96
|
+
"size": 1
|
|
97
|
+
},
|
|
98
|
+
"checkSendOfflineMsg": {
|
|
99
|
+
"type":"checkbox",
|
|
100
|
+
"sm": 12,
|
|
101
|
+
"md": 6,
|
|
102
|
+
"lg": 4,
|
|
103
|
+
"label": "Send offline message",
|
|
104
|
+
"help": "Get message if an device is not reachable"
|
|
105
|
+
},
|
|
106
|
+
"trenner": {
|
|
107
|
+
"newLine": true,
|
|
108
|
+
"type": "divider"
|
|
109
|
+
},
|
|
110
|
+
"checkSendBatteryMsg": {
|
|
111
|
+
"newLine": "true",
|
|
112
|
+
"type":"checkbox",
|
|
113
|
+
"sm": 4,
|
|
114
|
+
"md": 4,
|
|
115
|
+
"lg": 4,
|
|
116
|
+
"label": "Send batterie message",
|
|
117
|
+
"help": "Get message if an device has low battery"
|
|
118
|
+
},
|
|
119
|
+
"minWarnBatterie": {
|
|
120
|
+
"type": "number",
|
|
121
|
+
"min": 0,
|
|
122
|
+
"max": 100,
|
|
123
|
+
"sm": 8,
|
|
124
|
+
"md": 6,
|
|
125
|
+
"lg": 4,
|
|
126
|
+
"label": "From how much min % would you get a message",
|
|
127
|
+
"help": "in percent"
|
|
128
|
+
},
|
|
129
|
+
"chooseDay": {
|
|
130
|
+
"sm": 8,
|
|
131
|
+
"md": 6,
|
|
132
|
+
"lg": 4,
|
|
133
|
+
"items": {
|
|
134
|
+
"checkMonday": {
|
|
135
|
+
"type": "checkbox",
|
|
136
|
+
"label": "Mon"
|
|
137
|
+
},
|
|
138
|
+
"checkTuesday": {
|
|
139
|
+
"type": "checkbox",
|
|
140
|
+
"label": "Tue"
|
|
141
|
+
},
|
|
142
|
+
"checkWednesday": {
|
|
143
|
+
"type": "checkbox",
|
|
144
|
+
"label": "Wed"
|
|
145
|
+
},
|
|
146
|
+
"checkThursday": {
|
|
147
|
+
"type": "checkbox",
|
|
148
|
+
"label": "Thu"
|
|
149
|
+
},
|
|
150
|
+
"checkFriday": {
|
|
151
|
+
"type": "checkbox",
|
|
152
|
+
"label": "Fri"
|
|
153
|
+
},
|
|
154
|
+
"checkSaturday": {
|
|
155
|
+
"type": "checkbox",
|
|
156
|
+
"label": "Sat"
|
|
157
|
+
},
|
|
158
|
+
"checkSunday": {
|
|
159
|
+
"type": "checkbox",
|
|
160
|
+
"label": "Sun"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
"_headerPushover": {
|
|
165
|
+
"newLine": true,
|
|
166
|
+
"type": "header",
|
|
167
|
+
"text": "Pushover",
|
|
168
|
+
"size": 1
|
|
169
|
+
},
|
|
170
|
+
"instancePushover": {
|
|
171
|
+
"newLine": true,
|
|
172
|
+
"type": "instance",
|
|
173
|
+
"adapter": "pushover",
|
|
174
|
+
"all": true,
|
|
175
|
+
"allowDeactivate": true,
|
|
176
|
+
"sm": 12,
|
|
177
|
+
"md": 4,
|
|
178
|
+
"lg": 4,
|
|
179
|
+
"label": "Pushover Instance",
|
|
180
|
+
"help": "Please choose the pushover instance"
|
|
181
|
+
},
|
|
182
|
+
"devicePushover": {
|
|
183
|
+
"type": "text",
|
|
184
|
+
"sm": 12,
|
|
185
|
+
"md": 4,
|
|
186
|
+
"lg": 4,
|
|
187
|
+
"label": "Device-ID (optional)",
|
|
188
|
+
"help": "Choose your device"
|
|
189
|
+
},
|
|
190
|
+
"titlePushover": {
|
|
191
|
+
"type": "text",
|
|
192
|
+
"sm": 12,
|
|
193
|
+
"md": 4,
|
|
194
|
+
"lg": 4,
|
|
195
|
+
"label": "Title (optional)",
|
|
196
|
+
"help": "Choose your title for Pushmessage"
|
|
197
|
+
},
|
|
198
|
+
"headerTelegram": {
|
|
199
|
+
"newLine": "true",
|
|
200
|
+
"type": "header",
|
|
201
|
+
"text": "Telegram",
|
|
202
|
+
"size": 1
|
|
203
|
+
},
|
|
204
|
+
"instanceTelegram": {
|
|
205
|
+
"newLine": true,
|
|
206
|
+
"type": "instance",
|
|
207
|
+
"adapter": "telegram",
|
|
208
|
+
"all": true,
|
|
209
|
+
"allowDeactivate": true,
|
|
210
|
+
"sm": 12,
|
|
211
|
+
"md": 4,
|
|
212
|
+
"lg": 4,
|
|
213
|
+
"label": "Telegram Instance",
|
|
214
|
+
"help": "Please choose the telegram instance"
|
|
215
|
+
},
|
|
216
|
+
"deviceTelegram": {
|
|
217
|
+
"type": "text",
|
|
218
|
+
"sm": 12,
|
|
219
|
+
"md": 4,
|
|
220
|
+
"lg": 4,
|
|
221
|
+
"label": "Device-ID (optional)",
|
|
222
|
+
"help": "Choose your device"
|
|
223
|
+
},
|
|
224
|
+
"_headerEmail": {
|
|
225
|
+
"newLine": true,
|
|
226
|
+
"type": "header",
|
|
227
|
+
"text": "Email",
|
|
228
|
+
"size": 1
|
|
229
|
+
},
|
|
230
|
+
"instanceEmail": {
|
|
231
|
+
"newLine": true,
|
|
232
|
+
"type": "instance",
|
|
233
|
+
"adapter": "email",
|
|
234
|
+
"all": true,
|
|
235
|
+
"allowDeactivate": true,
|
|
236
|
+
"sm": 12,
|
|
237
|
+
"md": 4,
|
|
238
|
+
"lg": 4,
|
|
239
|
+
"label": "Email Instance",
|
|
240
|
+
"help": "Please choose the email instance"
|
|
241
|
+
},
|
|
242
|
+
"sendToEmail": {
|
|
243
|
+
"type": "text",
|
|
244
|
+
"sm": 12,
|
|
245
|
+
"md": 4,
|
|
246
|
+
"lg": 4,
|
|
247
|
+
"label": "Send to (optional)",
|
|
248
|
+
"help": "Choose your email address"
|
|
249
|
+
},
|
|
250
|
+
"subjectEmail": {
|
|
251
|
+
"type": "text",
|
|
252
|
+
"sm": 12,
|
|
253
|
+
"md": 4,
|
|
254
|
+
"lg": 4,
|
|
255
|
+
"label": "Subject (optional)",
|
|
256
|
+
"help": "Choose your subject for the Email"
|
|
257
|
+
},
|
|
258
|
+
"headerJarvis": {
|
|
259
|
+
"newLine": "true",
|
|
260
|
+
"type": "header",
|
|
261
|
+
"text": "Jarvis Notification",
|
|
262
|
+
"size": 1
|
|
263
|
+
},
|
|
264
|
+
"instanceJarvis": {
|
|
265
|
+
"newLine": true,
|
|
266
|
+
"type": "instance",
|
|
267
|
+
"adapter": "jarvis",
|
|
268
|
+
"allowDeactivate": true,
|
|
269
|
+
"all": true,
|
|
270
|
+
"sm": 12,
|
|
271
|
+
"md": 4,
|
|
272
|
+
"lg": 4,
|
|
273
|
+
"label": "Jarvis Instance",
|
|
274
|
+
"help": "Please choose the jarvis instance"
|
|
275
|
+
},
|
|
276
|
+
"titleJarvis": {
|
|
277
|
+
"type": "text",
|
|
278
|
+
"sm": 12,
|
|
279
|
+
"md": 4,
|
|
280
|
+
"lg": 4,
|
|
281
|
+
"label": "Title (optional)",
|
|
282
|
+
"help": "Choose your title for Pushmessage"
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
"_blacklist": {
|
|
287
|
+
"type": "panel",
|
|
288
|
+
"label": "Blacklist",
|
|
289
|
+
"items": {
|
|
290
|
+
"tableBlacklist": {
|
|
291
|
+
"type": "table",
|
|
292
|
+
"label": "Blacklist",
|
|
293
|
+
"nodelete": true,
|
|
294
|
+
"sm": 12,
|
|
295
|
+
"md": 12,
|
|
296
|
+
"lg": 12,
|
|
297
|
+
"items": [{
|
|
298
|
+
"type": "objectId",
|
|
299
|
+
"width":"100%",
|
|
300
|
+
"title": "Choose which devices should be excluded",
|
|
301
|
+
"attr": "device",
|
|
302
|
+
"filter": false,
|
|
303
|
+
"sort": false,
|
|
304
|
+
"default": ""
|
|
305
|
+
}]
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
package/admin/style.css
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* You can delete those if you want. I just found them very helpful */
|
|
2
|
+
* {
|
|
3
|
+
box-sizing: border-box
|
|
4
|
+
}
|
|
5
|
+
.m {
|
|
6
|
+
/* Don't cut off dropdowns! */
|
|
7
|
+
overflow: initial;
|
|
8
|
+
}
|
|
9
|
+
.m.adapter-container,
|
|
10
|
+
.m.adapter-container > div.App {
|
|
11
|
+
/* Fix layout/scrolling issues with tabs */
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
position: relative;
|
|
15
|
+
}
|
|
16
|
+
.m .select-wrapper + label {
|
|
17
|
+
/* The positioning for dropdown labels is messed up */
|
|
18
|
+
transform: none !important;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
label > i[title] {
|
|
22
|
+
/* Display the help cursor for the tooltip icons and fix their positioning */
|
|
23
|
+
cursor: help;
|
|
24
|
+
margin-left: 0.25em;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.dropdown-content {
|
|
28
|
+
/* Don't wrap text in dropdowns */
|
|
29
|
+
white-space: nowrap;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* Add your styles here */
|
package/admin/words.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*global systemDictionary:true */
|
|
2
|
+
/*
|
|
3
|
+
+===================== DO NOT MODIFY ======================+
|
|
4
|
+
| This file was generated by translate-adapter, please use |
|
|
5
|
+
| `translate-adapter adminLanguages2words` to update it. |
|
|
6
|
+
+===================== DO NOT MODIFY ======================+
|
|
7
|
+
*/
|
|
8
|
+
'use strict';
|
|
9
|
+
|
|
10
|
+
systemDictionary = {
|
|
11
|
+
'device-watcher adapter settings': {
|
|
12
|
+
'en': 'Adapter settings for device-watcher',
|
|
13
|
+
'de': 'Adaptereinstellungen für device-watcher',
|
|
14
|
+
'ru': 'Настройки адаптера для device-watcher',
|
|
15
|
+
'pt': 'Configurações do adaptador para device-watcher',
|
|
16
|
+
'nl': 'Adapterinstellingen voor device-watcher',
|
|
17
|
+
'fr': "Paramètres d'adaptateur pour device-watcher",
|
|
18
|
+
'it': "Impostazioni dell'adattatore per device-watcher",
|
|
19
|
+
'es': 'Ajustes del adaptador para device-watcher',
|
|
20
|
+
'pl': 'Ustawienia adaptera dla device-watcher',
|
|
21
|
+
'zh-cn': 'device-watcher的适配器设置'
|
|
22
|
+
},
|
|
23
|
+
'option1': {
|
|
24
|
+
'en': 'option1',
|
|
25
|
+
'de': 'Option 1',
|
|
26
|
+
'ru': 'Опция 1',
|
|
27
|
+
'pt': 'Opção 1',
|
|
28
|
+
'nl': 'Optie 1',
|
|
29
|
+
'fr': 'Option 1',
|
|
30
|
+
'it': 'opzione 1',
|
|
31
|
+
'es': 'Opción 1',
|
|
32
|
+
'pl': 'opcja 1',
|
|
33
|
+
'zh-cn': '选项1'
|
|
34
|
+
},
|
|
35
|
+
'option2': {
|
|
36
|
+
'en': 'option2',
|
|
37
|
+
'de': 'Option 2',
|
|
38
|
+
'ru': 'вариант 2',
|
|
39
|
+
'pt': 'opção 2',
|
|
40
|
+
'nl': 'Optie 2',
|
|
41
|
+
'fr': 'Option 2',
|
|
42
|
+
'it': 'opzione 2',
|
|
43
|
+
'es': 'opcion 2',
|
|
44
|
+
'pl': 'Opcja 2',
|
|
45
|
+
'zh-cn': '选项2'
|
|
46
|
+
}
|
|
47
|
+
};
|