iobroker.smartcontrol 2.0.1 → 2.1.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/LICENSE +2 -0
- package/README.md +25 -260
- package/admin/css/LICENSE-github-markdown-css.txt +24 -0
- package/admin/css/github-markdown-dark.min.css +8 -0
- package/admin/css/github-markdown.min.css +8 -0
- package/admin/doc-md/table-trigger-motion_de.md +1 -1
- package/admin/doc-md/table-trigger-motion_en.md +1 -1
- package/admin/doc-md/table-trigger-times_de.md +1 -1
- package/admin/doc-md/table-trigger-times_en.md +1 -1
- package/admin/i18n/en/translations.json +1 -0
- package/admin/index_m.js +207 -3
- package/admin/style.css +76 -8
- package/admin/tsconfig.json +9 -13
- package/io-package.json +31 -19
- package/lib/boolean-value.js +30 -0
- package/lib/constants.js +299 -65
- package/lib/cron-schedule.js +59 -0
- package/lib/helper.js +380 -373
- package/lib/midnight-reschedule.js +31 -0
- package/lib/motion-zone-timer.js +55 -0
- package/lib/num-comparator.js +70 -0
- package/lib/tools.js +12 -6
- package/lib/trigger-class.js +527 -282
- package/main.js +943 -625
- package/package.json +33 -31
package/admin/index_m.js
CHANGED
|
@@ -81,6 +81,187 @@ function load (settings, onChange) { /*eslint-disable-line no-unused-vars*/
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Helligkeit einer CSS-Hintergrundfarbe (nur opak, kein transparent).
|
|
86
|
+
*/
|
|
87
|
+
function luminanceFromCssColor(bg) {
|
|
88
|
+
const m = bg && bg.match(
|
|
89
|
+
/rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*([\d.]+))?\s*\)/,
|
|
90
|
+
);
|
|
91
|
+
if (!m) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
const alpha = m[4] !== undefined ? parseFloat(m[4]) : 1;
|
|
95
|
+
if (alpha < 0.05) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
return 0.299 * +m[1] + 0.587 * +m[2] + 0.114 * +m[3];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** Hellster sichtbarer Tab-Hintergrund (versteckte Tabs ignorieren). */
|
|
102
|
+
function pageBackgroundLuminance() {
|
|
103
|
+
let brightest = null;
|
|
104
|
+
const pages = document.querySelectorAll('.adapter-container .page, .page');
|
|
105
|
+
pages.forEach((page) => {
|
|
106
|
+
const style = getComputedStyle(page);
|
|
107
|
+
if (style.display === 'none' || style.visibility === 'hidden') {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const lum = luminanceFromCssColor(style.backgroundColor);
|
|
111
|
+
if (lum !== null && (brightest === null || lum > brightest)) {
|
|
112
|
+
brightest = lum;
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
if (brightest !== null) {
|
|
116
|
+
return brightest;
|
|
117
|
+
}
|
|
118
|
+
return luminanceFromCssColor(getComputedStyle(document.body).backgroundColor);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Markdown hell/dunkel: heller sichtbarer Hintergrund schlägt hängende react-dark-Klasse.
|
|
123
|
+
*/
|
|
124
|
+
function isAdminDarkTheme() {
|
|
125
|
+
const root = document.querySelector('.adapter-container');
|
|
126
|
+
if (
|
|
127
|
+
root &&
|
|
128
|
+
(root.classList.contains('react-light') || root.classList.contains('react-colored'))
|
|
129
|
+
) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const lum = pageBackgroundLuminance();
|
|
134
|
+
if (lum !== null && lum >= 140) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
if (lum !== null && lum < 90) {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return !!(
|
|
142
|
+
root &&
|
|
143
|
+
(root.classList.contains('react-dark') || root.classList.contains('react-blue'))
|
|
144
|
+
);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** Steuert style.css für Klapp-Hilfen (react-dark-Klasse kann nach Theme-Wechsel hängen bleiben). */
|
|
148
|
+
function syncMarkdownThemeMarker(adminIsDark) {
|
|
149
|
+
const root = document.querySelector('.adapter-container');
|
|
150
|
+
if (root) {
|
|
151
|
+
root.setAttribute('data-smartcontrol-md-theme', adminIsDark ? 'dark' : 'light');
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function clearZeroMdStylesheetCache() {
|
|
156
|
+
if (!window.ZeroMd || !window.ZeroMd.cache) {
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
Object.keys(window.ZeroMd.cache).forEach((key) => {
|
|
160
|
+
if (key.includes('github-markdown')) {
|
|
161
|
+
delete window.ZeroMd.cache[key];
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* zero-md lädt css-urls nur, wenn KEIN <template><style> gesetzt ist (siehe zero-md render).
|
|
168
|
+
*/
|
|
169
|
+
function applyZeroMdTheme(mdEl, adminIsDark) {
|
|
170
|
+
if (!mdEl) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const tpl = mdEl.querySelector('template');
|
|
174
|
+
if (tpl) {
|
|
175
|
+
const st = tpl.content.querySelector('style');
|
|
176
|
+
if (st) {
|
|
177
|
+
st.remove();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
clearZeroMdStylesheetCache();
|
|
181
|
+
const themeTag = adminIsDark ? 'dark' : 'light';
|
|
182
|
+
// Lokal im Adapter (kein CDN): Installationen ohne Internet behalten die Hilfe-Styles.
|
|
183
|
+
const cssFile = adminIsDark ? 'css/github-markdown-dark.min.css' : 'css/github-markdown.min.css';
|
|
184
|
+
const cssUrls = [`${cssFile}?sc=${themeTag}`];
|
|
185
|
+
mdEl.setAttribute('css-urls', JSON.stringify(cssUrls));
|
|
186
|
+
|
|
187
|
+
const onRendered = () => {
|
|
188
|
+
mdEl.removeEventListener('zero-md-rendered', onRendered);
|
|
189
|
+
if (!mdEl.shadowRoot) {
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
mdEl.shadowRoot.querySelectorAll('style.smartcontrol-md-extra').forEach((el) => el.remove());
|
|
193
|
+
const extra = document.createElement('style');
|
|
194
|
+
extra.className = 'smartcontrol-md-extra';
|
|
195
|
+
extra.textContent = adminIsDark ? ZERO_MD_DARK_SHADOW_STYLE : ZERO_MD_LIGHT_SHADOW_STYLE;
|
|
196
|
+
mdEl.shadowRoot.appendChild(extra);
|
|
197
|
+
};
|
|
198
|
+
mdEl.addEventListener('zero-md-rendered', onRendered);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/** Zusatz-CSS im zero-md Shadow DOM, falls das GitHub-Dark-Sheet nicht alles trifft */
|
|
202
|
+
const ZERO_MD_DARK_SHADOW_STYLE = `
|
|
203
|
+
.markdown-body {
|
|
204
|
+
color-scheme: dark;
|
|
205
|
+
background-color: transparent !important;
|
|
206
|
+
color: #e6edf3 !important;
|
|
207
|
+
}
|
|
208
|
+
.markdown-body p,
|
|
209
|
+
.markdown-body li,
|
|
210
|
+
.markdown-body td,
|
|
211
|
+
.markdown-body th {
|
|
212
|
+
color: #e6edf3 !important;
|
|
213
|
+
}
|
|
214
|
+
.markdown-body table tr {
|
|
215
|
+
background-color: transparent !important;
|
|
216
|
+
}
|
|
217
|
+
.markdown-body th {
|
|
218
|
+
background-color: #21262d !important;
|
|
219
|
+
}
|
|
220
|
+
.markdown-body a {
|
|
221
|
+
color: #58a6ff !important;
|
|
222
|
+
}
|
|
223
|
+
.markdown-body code {
|
|
224
|
+
background-color: rgba(110, 118, 129, 0.35) !important;
|
|
225
|
+
color: #e6edf3 !important;
|
|
226
|
+
}
|
|
227
|
+
`;
|
|
228
|
+
|
|
229
|
+
/** Hellmodus: überschreibt auch Reste von github-markdown-dark (dunkle Tabellenzeilen) */
|
|
230
|
+
const ZERO_MD_LIGHT_SHADOW_STYLE = `
|
|
231
|
+
.markdown-body {
|
|
232
|
+
color-scheme: light;
|
|
233
|
+
background-color: #ffffff !important;
|
|
234
|
+
color: #1f2328 !important;
|
|
235
|
+
}
|
|
236
|
+
.markdown-body p,
|
|
237
|
+
.markdown-body li,
|
|
238
|
+
.markdown-body td,
|
|
239
|
+
.markdown-body th,
|
|
240
|
+
.markdown-body strong {
|
|
241
|
+
color: #1f2328 !important;
|
|
242
|
+
}
|
|
243
|
+
.markdown-body table,
|
|
244
|
+
.markdown-body table tr,
|
|
245
|
+
.markdown-body table td,
|
|
246
|
+
.markdown-body table th {
|
|
247
|
+
background-color: #ffffff !important;
|
|
248
|
+
border-color: #d0d7de !important;
|
|
249
|
+
}
|
|
250
|
+
.markdown-body table tr:nth-child(2n) td {
|
|
251
|
+
background-color: #f6f8fa !important;
|
|
252
|
+
}
|
|
253
|
+
.markdown-body th {
|
|
254
|
+
background-color: #f6f8fa !important;
|
|
255
|
+
}
|
|
256
|
+
.markdown-body a {
|
|
257
|
+
color: #0969da !important;
|
|
258
|
+
}
|
|
259
|
+
.markdown-body code {
|
|
260
|
+
background-color: rgba(175, 184, 193, 0.2) !important;
|
|
261
|
+
color: #1f2328 !important;
|
|
262
|
+
}
|
|
263
|
+
`;
|
|
264
|
+
|
|
84
265
|
function load2(settings, onChange) {
|
|
85
266
|
// Adapter Settings
|
|
86
267
|
if (!settings) return;
|
|
@@ -95,7 +276,13 @@ function load2(settings, onChange) {
|
|
|
95
276
|
|
|
96
277
|
// index_m.html: All ids defined in <zero-md> tags, like ['md-start', 'md-targetDevices', ...]
|
|
97
278
|
const mdIds = $('zero-md[manual-render]').map((i, el) => el.getAttribute('id')).get(); // https://stackoverflow.com/a/54392415
|
|
279
|
+
|
|
280
|
+
const adminIsDark = isAdminDarkTheme();
|
|
281
|
+
syncMarkdownThemeMarker(adminIsDark);
|
|
282
|
+
|
|
98
283
|
for (const mdId of mdIds) {
|
|
284
|
+
const mdEl = document.querySelector('zero-md#' + mdId);
|
|
285
|
+
applyZeroMdTheme(mdEl, adminIsDark);
|
|
99
286
|
|
|
100
287
|
const mdFilePath = $('zero-md#' + mdId).attr('src'); // like 'doc-md/start_en.md'
|
|
101
288
|
if (mdFilePath) {
|
|
@@ -121,14 +308,31 @@ function load2(settings, onChange) {
|
|
|
121
308
|
}
|
|
122
309
|
|
|
123
310
|
// Finally, render zero-md - https://github.com/zerodevx/zero-md#public-methods
|
|
124
|
-
// We add a slight delay, just in case
|
|
125
311
|
setTimeout(() => {
|
|
126
312
|
const el = document.querySelector('zero-md#' + mdId);
|
|
127
|
-
if(el)
|
|
313
|
+
if (el) {
|
|
314
|
+
applyZeroMdTheme(el, adminIsDark);
|
|
315
|
+
el.render();
|
|
316
|
+
}
|
|
128
317
|
}, 100);
|
|
129
|
-
|
|
130
318
|
}
|
|
131
319
|
|
|
320
|
+
// Hilfe neu rendern, wenn Klappbereich aufgeht (Materialize-Collapsible)
|
|
321
|
+
$('.collapsible').off('click.smartcontrolMd', '.collapsible-header').on(
|
|
322
|
+
'click.smartcontrolMd',
|
|
323
|
+
'.collapsible-header',
|
|
324
|
+
function () {
|
|
325
|
+
setTimeout(() => {
|
|
326
|
+
const dark = isAdminDarkTheme();
|
|
327
|
+
syncMarkdownThemeMarker(dark);
|
|
328
|
+
$(this).siblings('.collapsible-body').find('zero-md[manual-render]').each(function () {
|
|
329
|
+
applyZeroMdTheme(this, dark);
|
|
330
|
+
this.render();
|
|
331
|
+
});
|
|
332
|
+
}, 350);
|
|
333
|
+
},
|
|
334
|
+
);
|
|
335
|
+
|
|
132
336
|
/**
|
|
133
337
|
* tableTargetEnums: set enum room and function names to drop down (multiple select) fields
|
|
134
338
|
*/
|
package/admin/style.css
CHANGED
|
@@ -29,15 +29,77 @@
|
|
|
29
29
|
.m .row .col.m1 { width: 14%; }
|
|
30
30
|
#tab-area { padding-left:0;padding-right:0; margin-top: 0px; margin-bottom: 1px; background-color:#174475; box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2) }
|
|
31
31
|
|
|
32
|
-
/* Tabs menu react-dark */
|
|
33
|
-
.m.react-dark .tabs .tab a.active,
|
|
34
|
-
.m.react-
|
|
35
|
-
.m.
|
|
32
|
+
/* Tabs menu react-dark / react-blue */
|
|
33
|
+
.m.react-dark .tabs .tab a.active,
|
|
34
|
+
.m.react-blue .tabs .tab a.active,
|
|
35
|
+
.m .tabs .tab a:hover {
|
|
36
|
+
color: #2196f3;
|
|
37
|
+
}
|
|
38
|
+
.m.react-dark .tabs,
|
|
39
|
+
.m.react-blue .tabs {
|
|
40
|
+
background-color: #272727 !important;
|
|
41
|
+
}
|
|
36
42
|
|
|
37
|
-
/*
|
|
38
|
-
.m
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
/* Hilfe (?): Theme über data-smartcontrol-md-theme (index_m.js), nicht nur react-dark (hängt oft fest) */
|
|
44
|
+
.m[data-smartcontrol-md-theme="light"] .collapsible-body {
|
|
45
|
+
background-color: #fafafa !important;
|
|
46
|
+
color: rgba(0, 0, 0, 0.87) !important;
|
|
47
|
+
}
|
|
48
|
+
.m[data-smartcontrol-md-theme="light"] .collapsible-body p,
|
|
49
|
+
.m[data-smartcontrol-md-theme="light"] .collapsible-body li,
|
|
50
|
+
.m[data-smartcontrol-md-theme="light"] .collapsible-body ol {
|
|
51
|
+
color: rgba(0, 0, 0, 0.87) !important;
|
|
52
|
+
}
|
|
53
|
+
.m[data-smartcontrol-md-theme="light"] .collapsible-body td:nth-child(1) {
|
|
54
|
+
color: #0d47a1 !important;
|
|
55
|
+
}
|
|
56
|
+
.m[data-smartcontrol-md-theme="dark"] .collapsible-body,
|
|
57
|
+
.m.react-dark .collapsible-body,
|
|
58
|
+
.m.react-blue .collapsible-body {
|
|
59
|
+
background-color: #303030 !important;
|
|
60
|
+
color: rgba(255, 255, 255, 0.87) !important;
|
|
61
|
+
}
|
|
62
|
+
.m[data-smartcontrol-md-theme="dark"] .collapsible-body th,
|
|
63
|
+
.m.react-dark .collapsible-body th,
|
|
64
|
+
.m.react-blue .collapsible-body th {
|
|
65
|
+
background-color: #424242 !important;
|
|
66
|
+
color: rgba(255, 255, 255, 0.87) !important;
|
|
67
|
+
}
|
|
68
|
+
.m[data-smartcontrol-md-theme="dark"] .collapsible-body td:nth-child(1),
|
|
69
|
+
.m.react-dark .collapsible-body td:nth-child(1),
|
|
70
|
+
.m.react-blue .collapsible-body td:nth-child(1) {
|
|
71
|
+
color: #90caf9 !important;
|
|
72
|
+
}
|
|
73
|
+
.m[data-smartcontrol-md-theme="dark"] .collapsible-body a:link,
|
|
74
|
+
.m[data-smartcontrol-md-theme="dark"] .collapsible-body a:visited,
|
|
75
|
+
.m.react-dark .collapsible-body a:link,
|
|
76
|
+
.m.react-dark .collapsible-body a:visited,
|
|
77
|
+
.m.react-blue .collapsible-body a:link,
|
|
78
|
+
.m.react-blue .collapsible-body a:visited {
|
|
79
|
+
color: #64b5f6;
|
|
80
|
+
}
|
|
81
|
+
.m[data-smartcontrol-md-theme="dark"] .collapsible-body code,
|
|
82
|
+
.m.react-dark .collapsible-body code,
|
|
83
|
+
.m.react-blue .collapsible-body code {
|
|
84
|
+
color: #81d4fa;
|
|
85
|
+
background-color: rgba(255, 255, 255, 0.08);
|
|
86
|
+
}
|
|
87
|
+
.m[data-smartcontrol-md-theme="dark"] p.translation-required,
|
|
88
|
+
.m.react-dark p.translation-required,
|
|
89
|
+
.m.react-blue p.translation-required {
|
|
90
|
+
color: #90caf9;
|
|
91
|
+
}
|
|
92
|
+
.m[data-smartcontrol-md-theme="dark"] .collapsible-body p,
|
|
93
|
+
.m[data-smartcontrol-md-theme="dark"] .collapsible-body li,
|
|
94
|
+
.m[data-smartcontrol-md-theme="dark"] .collapsible-body ol,
|
|
95
|
+
.m.react-dark .collapsible-body p,
|
|
96
|
+
.m.react-blue .collapsible-body p,
|
|
97
|
+
.m.react-dark .collapsible-body li,
|
|
98
|
+
.m.react-blue .collapsible-body li,
|
|
99
|
+
.m.react-dark .collapsible-body ol,
|
|
100
|
+
.m.react-blue .collapsible-body ol {
|
|
101
|
+
color: rgba(255, 255, 255, 0.87);
|
|
102
|
+
}
|
|
41
103
|
|
|
42
104
|
/* Table header */
|
|
43
105
|
table.table-values th.header { background-color:#64BfF6; font-size:90%; text-align:center; line-height: 1em; padding:6px 2px;}
|
|
@@ -86,6 +148,12 @@ code { padding: 2px 4px; font-size: 1.05em !important; color: #2696ef; backgroun
|
|
|
86
148
|
.page a:visited { color:#2696ef; } /* visited link */
|
|
87
149
|
.page a:hover { text-decoration: underline; } /* mouse over link */
|
|
88
150
|
.page a:active { color: #0d47a1; } /* selected link */
|
|
151
|
+
.m.react-dark .page a:link,
|
|
152
|
+
.m.react-blue .page a:link,
|
|
153
|
+
.m.react-dark .page a:visited,
|
|
154
|
+
.m.react-blue .page a:visited {
|
|
155
|
+
color: #64b5f6;
|
|
156
|
+
}
|
|
89
157
|
|
|
90
158
|
/* ****** collapsible sections ****** */
|
|
91
159
|
/* collapsible: general ****** */
|
package/admin/tsconfig.json
CHANGED
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
// this is necessary for the automatic typing of the adapter config
|
|
14
14
|
"resolveJsonModule": true,
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
// Raise error on 'this' expressions with an implied 'any' type. - https://github.com/Microsoft/TypeScript/issues/19639#issuecomment-590680337
|
|
17
|
+
"noImplicitThis": false,
|
|
17
18
|
|
|
18
19
|
// Set this to false if you want to disable the very strict rules (not recommended)
|
|
19
20
|
"strict": true,
|
|
@@ -26,24 +27,19 @@
|
|
|
26
27
|
// "noUnusedParameters": true,
|
|
27
28
|
|
|
28
29
|
// Consider targeting es2017 or higher if you require the new NodeJS 8+ features
|
|
29
|
-
"target": "es2017"
|
|
30
|
-
|
|
30
|
+
"target": "es2017"
|
|
31
31
|
},
|
|
32
32
|
"include": [
|
|
33
33
|
"**/*.js",
|
|
34
34
|
"**/*.d.ts",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
"../../iobroker.admin/www/lib/js/jquery-3.2.1.min.js",
|
|
36
|
+
"../../iobroker.admin/www/lib/js/socket.io.js",
|
|
37
|
+
"../../iobroker.admin/www/lib/js/materialize.js",
|
|
38
|
+
"../../iobroker.admin/www/js/adapter-settings.js",
|
|
39
|
+
"../../iobroker.admin/www/js/translate.js"
|
|
40
40
|
],
|
|
41
41
|
"exclude": [
|
|
42
42
|
"node_modules/**",
|
|
43
43
|
"admin/**"
|
|
44
|
-
]
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
]
|
|
47
45
|
}
|
|
48
|
-
|
|
49
|
-
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "smartcontrol",
|
|
4
|
-
"version": "2.0
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"news": {
|
|
6
|
+
"2.1.0": {
|
|
7
|
+
"en": "Accept valid 5-field cron triggers like `0 15 * * 1-5` again (fixes #281)\nNumber comparators accept negatives and decimals (`<-200`, `>26,5`) (fixes #164)\nBoolean comparison values: accept 1/0/on/off; clearer error if the value column is empty (fixes #170)\nHonour \"Do not verify\" for target off on timer timeout; URL targets (always do-not-verify) now call the off URL on every motion timeout (fixes #7)\nMotion off-timer once per zone, restart on last PIR (fixes #147)\nTime triggers at 00:00 fire before midnight re-schedule (fixes #8)\nAdmin: help markdown readable in light and dark ioBroker themes (fixes #5)\nMigrate to ESLint 9 and @iobroker/eslint-config (fixes #212)\nAdapter requires node.js >= 22.19.0 now\nAdapter requires node.js >= 22 now\nAdapter requires node.js >= 20 now.\nAdapter requires admin >= 7.7.22 now\nAdapter requires js-controller >= 6.0.11 now\nAdapter requires admin >= 7.6.17 now\nUpdated dependencies (adapter-core, release-script, testing, mocha) and repository checker fixes\n`npm run test:js` works again and unit tests run in CI via `test:unit`",
|
|
8
|
+
"de": "Akzeptiere 5 Cron-Trigger wie `0 15 * * 1-5` wieder (fixes #281)\nKomparatoren akzeptieren Negative und Dezimalzahlen (`<-200`, `>26,5`) (fixes #164)\nBoolesche Vergleichswerte: 1/0/an/aus; Fehler klarer, wenn die Wertespalte leer ist (behebt #170)\n„Nicht verifizieren“ bei Timeout beachten; URL-Ziele (immer nicht verifizieren) rufen die Off-URL jetzt bei jedem Timeout ab (behebt #7)\nAbschalten pro Zone, Neustart beim letzten PIR (Fixes #147)\nAuslösezeit um 00:00 Uhr vor Mitternacht umplanen (Fixes #8)\nAdmin: Help-Markdown in hellen und dunklen ioBroker-Themes (behebt #5)\nMigrieren zu ESLint 9 und @iobroker /eslint-config (fix #212)\nAdapter benötigt jetzt node.js >= 22.19.0\nAdapter benötigt jetzt node.js >= 22\nAdapter benötigt jetzt node.js >= 20.\nAdapter benötigt jetzt admin >= 7.7.22\nAdapter benötigt jetzt JS-Controller >= 6.0.11\nAdapter benötigt jetzt admin >= 7.6.17\nAbhängigkeiten (Adapter-Core, Release-Script, Testing, Mocha) und Repository-Checker behoben\n`npm run test:js` läuft wieder und Unit-Tests in CI über",
|
|
9
|
+
"ru": "Снова примите действительные триггеры cron из 5 полей, такие как `0 15 * * 1-5` (исправлено #281)\nКомпараторы чисел принимают отрицательные и десятичные числа (`<-200`, `>26,5`) (исправлено #164)\nБулевые значения сравнения: принимаются значения 1/0/on/off; более четкая ошибка, если столбец значений пуст (исправлено #170)\nОтметьте «Не проверять», если цель выключена по истечении времени ожидания таймера; целевые URL-адреса (всегда не проверяйте) теперь отключают URL-адрес при каждом тайм-ауте движения (исправлено #7)\nТаймер отключения движения один раз в каждой зоне, перезапуск на последнем PIR (исправление #147)\nВремя срабатывает в 00:00; перепланировка пожара до полуночи (исправление #8)\nAdmin: помощь в чтении разметки в светлых и темных темах IOBroker (исправления #5)\nПерейдите на ESLint 9 и @iobroker /eslint-config (исправления #212)\nТеперь для адаптера требуется файл node.js >= 22.19.0\nТеперь для адаптера требуется файл node.js >= 22\nТеперь для адаптера требуется файл node.js >= 20.\nДля адаптера теперь требуется администратор >= 7.7.22\nТеперь для адаптера требуется js-контроллер >= 6.0.11\nДля адаптера теперь требуется администратор >= 7.6.17\nОбновленные зависимости (ядро адаптера, сценарий выпуска, тестирование, mocha) и исправления для проверки репозиториев\n`npm run test:js` снова работает, а модульные тесты запускаются в CI через `test:unit`",
|
|
10
|
+
"pt": "Aceite novamente gatilhos cron de 5 campos como `0 15 * * 1-5` (fixes #281)\nComparadores aceitam negativos e decimais (`<-200`, `>26,5`) (fixes #164)\nComparação booleana: aceite 1/0/on/off; erro mais claro se a coluna estiver vazia (corrige #170)\nHonre o tempo limite de “Não verificar”; alvos de URL (sempre não verificam) agora cancelam o URL desligado a cada movimento (corrige #7)\nDesligue uma vez por zona, reinicie no último PIR (correções #147)\nO horário é reprogramado às 00:00 antes da meia-noite (corrige #8)\nAdmin: ajude o markdown a ser lido em temas IOBroker claros e escuros (correções #5)\nMigre para ESLint 9 e @iobroker /eslint-config (fixes #212)\nO adaptador exige node.js >= 22.19.0\nO adaptador exige node.js >= 2\nO adaptador exige node.js >= 20.\nAgora o adaptador exige admin >= 7.7.2\nO adaptador exige js-controller >= 6.0.11\nAgora o adaptador exige admin >= 7.6.17\nDependências atualizadas (adapter-core, release-script, testing, mocha) e correções\n`npm run test:js` e os testes unitários rodam em CI via `test:unit`",
|
|
11
|
+
"nl": "Accepteer opnieuw geldige cron-triggers met 5 velden, zoals `0 15 * * 1-5` (oplossingen #281)\nGetalvergelijkers accepteren negatieven en decimalen (`<-200`, `>26,5`) (oplossingen #164)\nBooleaanse vergelijkingswaarden: accepteer 1/0/aan/uit; duidelijkere fout als de waardekolom leeg is (oplossing #170)\nRespecteer „Niet verifiëren” voor de time-out van het doel wanneer de timer is uitgeschakeld; URL-doelen (altijd niet verifiëren) roepen nu de uit-URL aan bij elke time-out (oplossingen #7)\nEén keer per zone uitgeschakeld, timer opnieuw starten op de laatste PIR (oplossingen #147)\nDe tijd begint om 00:00 uur, de brand voor middernacht wordt opnieuw gepland (oplossingen #8)\nAdmin: help markdown leesbaar te maken in lichte en donkere IOBroker-thema's (oplossingen #5)\nMigreer naar ESLint 9 en @iobroker /eslint-config (oplossingen #212)\nVoor de adapter is nu node.js >= 22.19.0 nodig\nVoor de adapter is nu node.js >= 22 nodig\nVoor de adapter is nu node.js >= 20 nodig.\nAdapter vereist nu admin >= 7.7.22\nVoor de adapter is nu een js-controller >= 6.0.11 nodig\nAdapter vereist nu admin >= 7.6.17\nBijgewerkte afhankelijkheden (adapter-core, releasescript, testen, mokka) en fixes voor de controle van de repository\n`npm run test:js` werkt weer en unit-tests worden uitgevoerd in CI via `test:unit`",
|
|
12
|
+
"fr": "Acceptez à nouveau les cron à 5 champs valides, comme « 0 15 * * 1-5 » (fixes #281)\nLes comparateurs acceptent les négatifs et les décimales (`<-200`, `>26,5`) (fixes #164)\nComparaisons booléennes : acceptez 1/0/on/off ; erreur plus claire si la colonne est vide (fix #170)\nRépondez à « Ne pas vérifier » pour le timeout de la cible ; les URL cibles (à ne pas vérifier) appellent désormais l'URL désactivée à chaque motion (fixes #7)\nArrêt une fois par zone, redémarrage au dernier PIR (fix #147)\nL'heure se déclenche à 00h00 avant minuit (correction #8)\nAdmin : help Markdown lisible en clair et en foncé sur les thèmes IObroker (fixes #5)\nMigrez vers ESLint 9 et @iobroker /eslint-config (fixes #212)\nAdapter nécessite node.js >= 22.19.0\nAdapter nécessite node.js >= 22\nAdapter nécessite node.js >= 20.\nAdapter nécessite admin >= 7.7.22\nAdapter nécessite JS-Controller >= 6.0.11\nAdapter nécessite admin >= 7.6.17\nDépendances mises à jour (adapter-core, release-script, testing, Mocha) et correctifs de dépôt\n`npm run test:js` redémarre et effectue des tests unitaires en CI via `test:unit`",
|
|
13
|
+
"it": "Accetti cron trigger validi a 5 campi come `0 15 * * 1-5` (fix #281)\nI comparatori accettano numeri negativi e decimali (<-200, >26,5) (fix #164)\nConfronto booleano: accetta 1/0/on/off; errore più chiaro se la colonna è vuota (fix #170)\nOnora «Non verificare» per il timeout del timer; gli URL target (sempre non verificare) ora richiamano l'URL off a ogni motion timeout (correzioni #7)\nSpegnimento 1 per zona, riavvio all'ultimo PIR (fix #147)\nL'ora scatta alle 00:00 prima di mezzanotte (fix #8)\nAdmin: aiuto markdown leggibile in temi IOBroker chiari e scuri (fix #5)\nPassa a ESLint 9 e @iobroker /eslint-config (fix #212)\nAdapter richiede node.js >= 22.19.0 ora\nAdapter richiede node.js =2 ora\nAdapter richiede node.js >= 20 ora.\nAdapter richiede admin >= 7.7.2 ora\nAdapter richiede js-controller >= 6.0.11 ora\nAdapter richiede admin >= 7.6.17 ora\nDipendenze aggiornate (adapter-core, release-script, testing, moka) e correzioni\n`npm run test:js` funziona di nuovo e gli unit test in CI via `test:unit`",
|
|
14
|
+
"es": "Vuelva a aceptar cron de 5 campos válidos, como 0 15 * 1 a 5 (corrige #281)\nLos comparadores de números aceptan negativos y decimales (<-200, >26,5) (corrige #164)\nValores de comparación booleanos: aceptar 1/0/off; error más claro si la columna de valores está vacía (corrige #170)\nRespete «No verificar» para cerrar el tiempo límite; los objetivos URL (siempre no verificar) ahora llaman a la URL desactivada en cada movimiento (corrige #7)\nDesactiva una vez por zona, reinicia en el último PIR (corrige #147)\nLa hora se activa a las 00:00 fuego antes de medianoche (corrige #8)\nAdmin: ayuda a que Markdown se lea en temas claros y oscuros de IOBroker (corrige #5)\nMigre a ESLint 9 y @iobroker /eslint-config (fixes #212)\nEl adaptador ahora necesita node.js >= 22.19.0\nEl adaptador necesita node.js >= 22 ahora\nEl adaptador necesita node.js >= 20 ahora.\nEl adaptador necesita admin >= 7.7.22 ahora\nEl adaptador ahora requiere js-controller >= 6.0.11\nEl adaptador necesita admin >= 7.6.17 ahora\nSe actualizaron las dependencias (adapter-core, release-script, testing, mocha) y repositorios\n`npm run test:js` vuelve a funcionar y las pruebas unitarias en CI con `test:unit`",
|
|
15
|
+
"pl": "Ponownie zaakceptuj prawidłowe 5-polowe wyzwalacze cron, takie jak `0 15* * 1-5` (poprawki #281)\nKomparatory liczbowe akceptują wartości ujemne i dziesiętne (`<-200`, `>26,5`) (poprawki #164)\nWartości porównawcze logiczne: akceptuj 1/0/on/off; wyraźniejszy błąd, jeśli kolumna wartości jest pusta (poprawki #170)\nUhonoruj „Nie weryfikuj” dla celu wyłączonego z limitu czasu czasu; adresy docelowe adresów URL (zawsze nie weryfikuj) teraz wywołują wyłączony adres URL przy każdym limitu czasu ruchu (poprawki #7)\nWyłącznik ruchu raz na strefę, uruchom ponownie na ostatnim PIR (poprawki #147)\nCzas uruchamia się o 00:00 pożar przed północą ponownie harmonogram (poprawki #8)\nAdministrator: pomoc w znaczeniu czytelnym w jasnych i ciemnych motywach ioBroker (poprawki #5)\nMigracja do eSlint 9 i @iobroker /eslint-config (poprawki #212)\nAdapter wymaga teraz node.js >= 22.19.0\nAdapter wymaga teraz node.js >= 22\nAdapter wymaga teraz node.js >= 20.\nAdapter wymaga administratora >= 7.7.22 teraz\nAdapter wymaga kontrolera js->= 6.0.11 teraz\nAdapter wymaga administratora >= 7.6.17\nZaktualizowane zależności (rdzeń adaptera, release-script, testing, mocha) i poprawki sprawdzania repozytorium\n`npm run test:js` działa ponownie, a testy jednostkowe są uruchamiane w CI poprzez `test:unit`",
|
|
16
|
+
"uk": "Знову прийміть дійсні 5-польові тригери cron, такі як `0 15 * * 1-5` (виправлення #281)\nКомпаратори чисел приймають негативні та десяткові числа (`<-200`, `>26,5`) (виправлення #164)\nБулеві значення порівняння: прийняти 1/0/включення/вимкнення; чіткіша помилка, якщо стовпець значення порожній (виправлено #170)\nВизначте «Не перевіряти» для вимкнення цілі під час тайм-ауту таймера; цільові адреси (завжди не перевіряйте) тепер викликають вимкнену URL-адресу під час кожного тайм-ауту руху (виправлення #7)\nЧас відключення руху один раз на зону, перезапуск на останньому PIR (виправлення #147)\nЧас спрацьовує о 00:00 пожежі до опівночі перепланування (виправлення #8)\nАдміністратор: допомога уцінки читається у світлих і темних темах IObroker (виправлення #5)\nМіграція до ESLint 9 та @iobroker /eslint-config (виправлення #212)\nАдаптер вимагає node.js >= 22.19.0 зараз\nАдаптер вимагає node.js >= 22 зараз\nТепер адаптер вимагає node.js >= 20.\nАдаптер вимагає адміністратора >= 7.7.22 зараз\nАдаптер вимагає js-контролера >= 6.0.11 зараз\nАдаптер вимагає адміністратора >= 7.6.17 зараз\nОновлені залежності (адаптер-ядро, сценарій випуску, тестування, mocha) та виправлення перевірки сховища\n`npm run test:js` знову працює, а одиничні тести виконуються в CI через `test:unit`",
|
|
17
|
+
"zh-cn": "再次接受有效的 5 字段 cron 触发器,例如 `0 15 * * 1-5`(修复 #281)\n数字比较器接受负数和小数(`<-200`,`>26,5`)(修复 #164)\n布尔比较值:接受 1/0/on/off;如果值列为空,则错误更清晰(修复 #170)\n对于在计时器超时时关闭目标,尊重 “请勿验证”;URL 目标(始终不验证)现在会在每次动作超时时取消关闭 URL(修复 #7)\n每个区域关闭动作计时器一次,在最后一个 PIR 时重启(修复 #147)\n00:00 的时间触发器在午夜重新安排之前触发(修复 #8)\n管理员:帮助 markdown 在浅色和深色的 IOBroker 主题中均可读(修复 #5)\n迁移到 ESLint 9 和 @iobroker /eslint-config(修复 #212)\n适配器现在需要 node.js >= 22.19.0\n适配器现在需要 node.js >= 22\n适配器现在需要 node.js >= 20。\n适配器现在需要管理员 >= 7.7.22\n适配器现在需要 js-controller >= 6.0.11\n适配器现在需要管理员 >= 7.6.17\n更新的依赖关系(适配器内核、发布脚本、测试、mocha)和存储库检查器修复\n`npm run test: js` 再次起作用,单元测试通过 `test: unit` 在 CI 中运行"
|
|
18
|
+
},
|
|
6
19
|
"2.0.1": {
|
|
7
20
|
"en": "warn log for not existing objects removed (fixed)\nupdated readme\nsupported only node 16 or higher\nupdated packages",
|
|
8
21
|
"de": "warnen log für nicht vorhandene objekte entfernt (fixiert)\naktualisierte version\nunterstützt nur knoten 16 oder höher\naktualisierte pakete",
|
|
@@ -79,18 +92,6 @@
|
|
|
79
92
|
"es": "Mejora: ahora, todas las validaciones de la configuración del adaptador tienen lugar mientras se guarda la configuración del adaptador, y todos los errores identificados se muestran en un cuadro de diálogo. Aborda el problema # 61",
|
|
80
93
|
"pl": "Ulepszenie: teraz wszystkie sprawdzanie poprawności konfiguracji adaptera mają miejsce podczas zapisywania konfiguracji adaptera, a wszystkie zidentyfikowane błędy są wyświetlane w oknie dialogowym. Rozwiązuje problem nr 61",
|
|
81
94
|
"zh-cn": "增强功能:现在,所有适配器配置验证都在保存适配器配置的同时进行,并且所有已识别的错误均显示在对话框中。解决了问题61"
|
|
82
|
-
},
|
|
83
|
-
"1.2.0": {
|
|
84
|
-
"en": "Fix: issue #60 - Linked triggers of motion sensors issue; Several code improvements; Issues #35 and #43 confirmed as resolved, therefore all workaround code removed",
|
|
85
|
-
"de": "Fix: Issue #60 - Problem mit verknüpften Auslösern von Bewegungssensoren; Mehrere Codeverbesserungen; Issues #35 und #43 wurden als behoben bestätigt, daher wurde der gesamte Workaround-Code entfernt",
|
|
86
|
-
"ru": "Исправлено: проблема №60 - проблема связанных триггеров датчиков движения; Несколько улучшений кода; Проблемы №35 и №43 подтверждены как решенные, поэтому весь код обходного решения удален.",
|
|
87
|
-
"pt": "Correção: problema nº 60 - Problemas vinculados aos sensores de movimento; Várias melhorias de código; Os problemas nº 35 e nº 43 foram confirmados como resolvidos, portanto, todo o código de solução alternativa foi removido",
|
|
88
|
-
"nl": "Oplossing: probleem # 60 - Probleem met gekoppelde triggers van bewegingssensoren; Diverse codeverbeteringen; Problemen # 35 en # 43 bevestigd als opgelost, daarom is alle tijdelijke code verwijderd",
|
|
89
|
-
"fr": "Correction: problème n ° 60 - Problème lié aux déclencheurs liés aux capteurs de mouvement; Plusieurs améliorations de code; Problèmes n ° 35 et n ° 43 confirmés comme résolus, par conséquent tout le code de solution de contournement a été supprimé",
|
|
90
|
-
"it": "Correzione: problema # 60 - Problemi relativi ai trigger collegati dei sensori di movimento; Diversi miglioramenti al codice; I problemi # 35 e # 43 sono stati confermati come risolti, quindi tutto il codice della soluzione alternativa è stato rimosso",
|
|
91
|
-
"es": "Solución: problema n. ° 60: problemas relacionados con los activadores de los sensores de movimiento; Varias mejoras de código; Los problemas n. ° 35 y n. ° 43 se confirmaron como resueltos, por lo tanto, se eliminó todo el código de solución.",
|
|
92
|
-
"pl": "Poprawka: problem # 60 - Problem z połączonymi wyzwalaczami czujników ruchu; Kilka ulepszeń kodu; Potwierdzono, że problemy 35 i 43 zostały rozwiązane, w związku z czym usunięto cały kod obejścia",
|
|
93
|
-
"zh-cn": "修复:问题60-运动传感器的链接触发器问题;几处代码改进;问题#35和#43确认已解决,因此删除了所有解决方法代码"
|
|
94
95
|
}
|
|
95
96
|
},
|
|
96
97
|
"titleLang": {
|
|
@@ -118,8 +119,9 @@
|
|
|
118
119
|
"zh-cn": "控制设备更智能:通过分组(包括动作,打开窗口等)进行分组,并相应地设置目标设备"
|
|
119
120
|
},
|
|
120
121
|
"authors": [
|
|
121
|
-
"oelison <iobrokersmartcontrol
|
|
122
|
-
"Mic-M <iob.micm@gmail.com>"
|
|
122
|
+
"oelison <iobrokersmartcontrol@sciphy.de>",
|
|
123
|
+
"Mic-M <iob.micm@gmail.com>",
|
|
124
|
+
"iobroker-community-adapters <iobroker-community-adapters@gmx.de>"
|
|
123
125
|
],
|
|
124
126
|
"keywords": [
|
|
125
127
|
"smart",
|
|
@@ -134,30 +136,40 @@
|
|
|
134
136
|
"schedule",
|
|
135
137
|
"zones"
|
|
136
138
|
],
|
|
137
|
-
"
|
|
139
|
+
"licenseInformation": {
|
|
140
|
+
"type": "free",
|
|
141
|
+
"license": "MIT"
|
|
142
|
+
},
|
|
138
143
|
"platform": "Javascript/Node.js",
|
|
139
|
-
"main": "main.js",
|
|
140
144
|
"icon": "smartcontrol.png",
|
|
141
145
|
"enabled": true,
|
|
142
146
|
"extIcon": "https://raw.githubusercontent.com/iobroker-community-adapters/ioBroker.smartcontrol/master/admin/smartcontrol.png",
|
|
143
147
|
"readme": "https://github.com/iobroker-community-adapters/ioBroker.smartcontrol/blob/master/README.md",
|
|
144
148
|
"loglevel": "info",
|
|
149
|
+
"tier": 2,
|
|
145
150
|
"mode": "daemon",
|
|
146
151
|
"type": "logic",
|
|
147
152
|
"compact": true,
|
|
148
153
|
"connectionType": "local",
|
|
149
154
|
"dataSource": "poll",
|
|
150
|
-
"materialize": true,
|
|
151
155
|
"messagebox": true,
|
|
152
156
|
"dependencies": [
|
|
153
157
|
{
|
|
154
|
-
"js-controller": ">=
|
|
158
|
+
"js-controller": ">=6.0.11"
|
|
155
159
|
}
|
|
156
160
|
],
|
|
157
161
|
"plugins": {
|
|
158
162
|
"sentry": {
|
|
159
163
|
"dsn": "https://5a01dc9b29b846218064c49700c7a302@sentry.iobroker.net/94"
|
|
160
164
|
}
|
|
165
|
+
},
|
|
166
|
+
"globalDependencies": [
|
|
167
|
+
{
|
|
168
|
+
"admin": ">=7.7.22"
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"adminUI": {
|
|
172
|
+
"config": "materialize"
|
|
161
173
|
}
|
|
162
174
|
},
|
|
163
175
|
"native": {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Liest true/false aus der Konfigurations-Spalte (Vergleichswert).
|
|
5
|
+
*
|
|
6
|
+
* Warum: Nur exakt 'true'/'false' wurde akzeptiert. TRUE/1/on usw. und
|
|
7
|
+
* eine klarere Fehlermeldung, wenn die Spalte leer ist (#170).
|
|
8
|
+
* Ein leeres Feld bleibt ungültig – der Vergleichswert muss gesetzt sein.
|
|
9
|
+
*
|
|
10
|
+
* @param {unknown} val
|
|
11
|
+
* @returns {{ok: boolean, value?: boolean}}
|
|
12
|
+
*/
|
|
13
|
+
function parseBooleanStateVal(val) {
|
|
14
|
+
if (typeof val === 'boolean') {
|
|
15
|
+
return { ok: true, value: val };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const s = val == null ? '' : String(val).trim().toLowerCase();
|
|
19
|
+
if (s === 'true' || s === '1' || s === 'on') {
|
|
20
|
+
return { ok: true, value: true };
|
|
21
|
+
}
|
|
22
|
+
if (s === 'false' || s === '0' || s === 'off') {
|
|
23
|
+
return { ok: true, value: false };
|
|
24
|
+
}
|
|
25
|
+
return { ok: false };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
module.exports = {
|
|
29
|
+
parseBooleanStateVal,
|
|
30
|
+
};
|