iobroker.smartcontrol 2.1.0 → 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.
Files changed (115) hide show
  1. package/README.md +21 -10
  2. package/admin/custom/assets/Components-CevOCMYi.js +77 -0
  3. package/admin/custom/assets/Components-DIpDvtxi.js +1 -0
  4. package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__SmartcontrolSet__mf_owner__1-C9SdP7_s.js +1 -0
  5. package/admin/custom/assets/_virtual_mf___mfe_internal__SmartcontrolSet__mf_owner__108197177487852__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-Ca-6Y14s.js +1525 -0
  6. package/admin/custom/assets/_virtual_mf___mfe_internal__SmartcontrolSet__mf_owner__108197177487852__loadShare__shared-4MdeZwge.js +2 -0
  7. package/admin/custom/assets/_virtual_mf___mfe_internal__SmartcontrolSet__mf_owner__108197177487852__prebuild___mf_0_iobroker_mf_1_json_mf_2_config__prebuild__-QT6he7QZ.js +122 -0
  8. package/admin/custom/assets/_virtual_mf___mfe_internal__SmartcontrolSet__mf_owner__108197177487852__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-BWTOCVCn.js +1 -0
  9. package/admin/custom/assets/dist-Cnxr-ruU.js +1 -0
  10. package/admin/custom/assets/helpers-CNHzo155.js +1 -0
  11. package/admin/custom/assets/hostInit-BVoHSU7s.js +1 -0
  12. package/admin/custom/assets/iconLibraryData-B5fiyl1C.js +1 -0
  13. package/admin/custom/assets/index-DKuAVH1b.js +1 -0
  14. package/admin/custom/assets/lib-CgOpGT17.js +3 -0
  15. package/admin/custom/assets/mf-entry-bootstrap-0-c2b3685a.js +54 -0
  16. package/admin/custom/assets/pendingShares-CEz9fejL.js +2 -0
  17. package/admin/custom/assets/prod-XWAlCKxB.js +492 -0
  18. package/admin/custom/assets/rolldown-runtime-9C0vUP4u.js +1 -0
  19. package/admin/custom/assets/utils-DmVoYT7i.js +4 -0
  20. package/admin/custom/assets/vite-preload-helper-nldAWQd6.js +1 -0
  21. package/admin/custom/customComponents.js +12 -0
  22. package/admin/custom/i18n/de.json +59 -0
  23. package/admin/custom/i18n/en.json +59 -0
  24. package/admin/custom/i18n/es.json +59 -0
  25. package/admin/custom/i18n/fr.json +59 -0
  26. package/admin/custom/i18n/it.json +59 -0
  27. package/admin/custom/i18n/nl.json +59 -0
  28. package/admin/custom/i18n/pl.json +59 -0
  29. package/admin/custom/i18n/pt.json +59 -0
  30. package/admin/custom/i18n/ru.json +59 -0
  31. package/admin/custom/i18n/uk.json +59 -0
  32. package/admin/custom/i18n/zh-cn.json +59 -0
  33. package/admin/custom/mf-manifest.json +1 -0
  34. package/admin/doc-md/readme.txt +2 -6
  35. package/admin/doc-md/start_de.md +34 -89
  36. package/admin/doc-md/start_en.md +33 -90
  37. package/admin/doc-md/table-conditions_de.md +7 -9
  38. package/admin/doc-md/table-conditions_en.md +7 -9
  39. package/admin/doc-md/table-execution_de.md +11 -10
  40. package/admin/doc-md/table-execution_en.md +12 -11
  41. package/admin/doc-md/table-options_de.md +58 -0
  42. package/admin/doc-md/table-options_en.md +58 -0
  43. package/admin/doc-md/table-target-devices_de.md +20 -16
  44. package/admin/doc-md/table-target-devices_en.md +18 -16
  45. package/admin/doc-md/table-target-enums_de.md +13 -13
  46. package/admin/doc-md/table-target-enums_en.md +12 -14
  47. package/admin/doc-md/table-target-url_de.md +14 -25
  48. package/admin/doc-md/table-target-url_en.md +14 -23
  49. package/admin/doc-md/table-trigger-devices_de.md +10 -11
  50. package/admin/doc-md/table-trigger-devices_en.md +10 -10
  51. package/admin/doc-md/table-trigger-motion_de.md +41 -24
  52. package/admin/doc-md/table-trigger-motion_en.md +35 -19
  53. package/admin/doc-md/table-trigger-times_de.md +11 -12
  54. package/admin/doc-md/table-trigger-times_en.md +11 -11
  55. package/admin/doc-md/table-zones_de.md +19 -14
  56. package/admin/doc-md/table-zones_en.md +19 -14
  57. package/admin/doc-md/table-zones_select-targets_de.md +7 -15
  58. package/admin/doc-md/table-zones_select-targets_en.md +7 -15
  59. package/admin/i18n/{de/translations.json → de.json} +2 -1
  60. package/admin/i18n/{en/translations.json → en.json} +2 -1
  61. package/admin/i18n/{es/translations.json → es.json} +2 -1
  62. package/admin/i18n/{fr/translations.json → fr.json} +2 -1
  63. package/admin/i18n/{it/translations.json → it.json} +2 -1
  64. package/admin/i18n/{nl/translations.json → nl.json} +2 -1
  65. package/admin/i18n/{pl/translations.json → pl.json} +2 -1
  66. package/admin/i18n/{pt/translations.json → pt.json} +2 -1
  67. package/admin/i18n/{ru/translations.json → ru.json} +2 -1
  68. package/admin/i18n/uk.json +110 -0
  69. package/admin/i18n/{zh-cn/translations.json → zh-cn.json} +2 -1
  70. package/admin/img/option-screenshots/tab-conditions.png +0 -0
  71. package/admin/img/option-screenshots/tab-further-options.png +0 -0
  72. package/admin/img/option-screenshots/tab-start.png +0 -0
  73. package/admin/img/option-screenshots/tab-target-devices.png +0 -0
  74. package/admin/img/option-screenshots/tab-triggers-motion.png +0 -0
  75. package/admin/img/option-screenshots/tab-triggers-other.png +0 -0
  76. package/admin/img/option-screenshots/tab-triggers-time.png +0 -0
  77. package/admin/img/option-screenshots/tab-zones-execution.png +0 -0
  78. package/admin/img/option-screenshots/tab-zones.png +0 -0
  79. package/admin/jsonConfig.json5 +569 -0
  80. package/io-package.json +30 -27
  81. package/lib/helper.js +40 -6
  82. package/lib/trigger-class.js +185 -80
  83. package/lib/trigger-match.js +76 -0
  84. package/main.js +132 -62
  85. package/package.json +11 -21
  86. package/admin/admin.d.ts +0 -4
  87. package/admin/css/LICENSE-github-markdown-css.txt +0 -24
  88. package/admin/css/github-markdown-dark.min.css +0 -8
  89. package/admin/css/github-markdown.min.css +0 -8
  90. package/admin/doc-md/img/start_dropdown-ani.gif +0 -0
  91. package/admin/doc-md/img/start_open-dialog.png +0 -0
  92. package/admin/doc-md/img/start_show-explanation.gif +0 -0
  93. package/admin/doc-md/img/table-zones_select-target-devices-overwrite.gif +0 -0
  94. package/admin/fancytree/skin-lion/icons-rtl.gif +0 -0
  95. package/admin/fancytree/skin-lion/icons.gif +0 -0
  96. package/admin/fancytree/skin-lion/loading.gif +0 -0
  97. package/admin/fancytree/skin-lion/ui.fancytree.min.css +0 -6
  98. package/admin/fancytree/skin-lion/vline-rtl.gif +0 -0
  99. package/admin/fancytree/skin-lion/vline.gif +0 -0
  100. package/admin/img/info-big.png +0 -0
  101. package/admin/img/info-big.png_README.txt +0 -6
  102. package/admin/img/sc_always.png +0 -0
  103. package/admin/img/select-target-devices-overwrite.gif +0 -0
  104. package/admin/img/smartControl_options1.gif +0 -0
  105. package/admin/img/smartControl_options_dropdown.gif +0 -0
  106. package/admin/img/smartControl_options_dropdown_2.gif +0 -0
  107. package/admin/index_m.html +0 -812
  108. package/admin/index_m.js +0 -1659
  109. package/admin/style.css +0 -255
  110. package/admin/tsconfig.json +0 -45
  111. package/admin/words.js +0 -113
  112. package/admin/zero-md/readme.txt +0 -1
  113. package/admin/zero-md/webcomponents-loader.min.js +0 -9
  114. package/admin/zero-md/zero-md.min.js.js +0 -9
  115. package/lib/tools.js +0 -99
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "smartcontrol",
4
- "version": "2.1.0",
4
+ "version": "2.2.1",
5
5
  "news": {
6
+ "2.2.1": {
7
+ "en": "Admin: zone sections stay open and the cursor stays in place while typing (#388)\nAdmin: custom components and the trigger ACK options are translated into all languages\nRemoved the unused lib/tools.js",
8
+ "de": "Admin: Zonen bleiben aufgeklappt und der Cursor bleibt beim Tippen an seiner Stelle (#388)\nAdmin: Eigene Komponenten und die Trigger-ACK-Optionen sind in alle Sprachen übersetzt\nUnbenutztes lib/tools.js entfernt",
9
+ "ru": "Администратор: разделы зоны остаются открытыми, а курсор остается на месте при наборе текста (#388)\nAdmin: пользовательские компоненты и опции триггера ACK переведены на все языки\nУдален неиспользуемый файл lib/tools.js",
10
+ "pt": "Admin: as seções da zona ficam abertas e o cursor no lugar ao digitar (#388)\nAdmin: componentes personalizados e opções ACK são traduzidos em todos os idiomas\nRemovido o lib/tools.js não usado",
11
+ "nl": "Admin: zonesecties blijven open en de cursor blijft op zijn plaats tijdens het typen (#388)\nAdmin: aangepaste componenten en de ACK-activeringsopties zijn in alle talen vertaald\nDe ongebruikte lib/tools.js verwijderd",
12
+ "fr": "Admin : les zones restent ouvertes et le curseur reste en place pendant la saisie (#388)\nAdmin : les composants personnalisés et les options ACK sont traduits dans toutes les langues\nSuppression du lib/tools.js inutilisé",
13
+ "it": "Admin: le sezioni delle zone restano aperte e il cursore resta al suo posto durante la digitazione (#388)\nAdmin: i componenti personalizzati e i trigger ACK sono tradotti in tutte le lingue\nRimosso il lib/tools.js inusato",
14
+ "es": "Admin: las secciones de zona permanecen abiertas y el cursor no se mueve al escribir (#388)\nAdmin: los componentes personalizados y las opciones de ACK se traducen a todos los idiomas\nSe eliminó el lib/tools.js sin usar",
15
+ "pl": "Administrator: sekcje stref pozostają otwarte, a kursor pozostaje na miejscu podczas pisania (#388)\nAdministrator: komponenty niestandardowe i opcje wyzwalacza ACK są tłumaczone na wszystkie języki\nUsunięto nieużywany lib/tools.js",
16
+ "uk": "Адміністратор: розділи зони залишаються відкритими, а курсор залишається на місці під час введення тексту (#388)\nАдміністратор: користувальницькі компоненти та параметри запуску ACK перекладені на всі мови\nВидалено невикористаний lib/tools.js",
17
+ "zh-cn": "管理员:区域部分保持打开状态,键入时光标保持原位 (#388)\n管理员:自定义组件和触发器 ACK 选项已翻译成所有语言\n移除了未使用的 lib/tools.js"
18
+ },
19
+ "2.2.0": {
20
+ "en": "Updated packages (axios, cron-parser 5 and others)\nAdmin: jsonConfig UI (replaces Materialize `index_m`) with verifyConfig gate (addresses #309)\nZone target overwrite: accept legacy string values at runtime (`\"95\"` or `{ val, delay }`)\nDocument that trigger names can use dots as group folders in zones (addresses #22)\nOptional recheck of trigger and zone conditions after zone on-delay (addresses #4)\nHelp: tip how to send notifications via messenger states (fixes #6)\nAdded Ukrainian (uk) translations for io-package.json and admin (#368)\nAdmin: recheck-after-delay column as icon with tooltip; i18n and German label from #370 review\nAdmin UI (src-admin): updated packages (React 19.3, MUI 9.6, json-config 10, marked 18) and rebuilt the bundle\nRepository checker: test packages now come from @iobroker/testing, added @iobroker/adapter-dev and .vscode/settings.json\nTimers use adapter.setTimeout()/clearTimeout(), so they are cleared when the instance stops\nAdmin translations moved to the short i18n format (admin/i18n/{lang}.json)\nAdmin: the settings use the full height of the page (measured instead of a fixed offset)",
21
+ "de": "Pakete aktualisiert (axios, cron-parser 5 u. a.)\nAdmin: jsonConfig-Oberfläche (ersetzt Materialize `index_m`) mit Konfigurationsprüfung vor dem Speichern (#309)\nÜberschreiben von Zonenzielen: alte String-Werte werden zur Laufzeit akzeptiert (`\"95\"` oder `{ val, delay }`)\nDokumentiert: Auslösernamen können Punkte als Gruppenordner in Zonen verwenden (#22)\nOptionale erneute Prüfung von Auslöser- und Zonenbedingungen nach der Einschaltverzögerung der Zone (#4)\nHilfe: Tipp, wie man Benachrichtigungen über Messenger-States sendet (behebt #6)\nUkrainische Übersetzungen (uk) für io-package.json und Admin hinzugefügt (#368)\nAdmin: Spalte „Erneut prüfen nach Verzögerung“ als Symbol mit Tooltip; Übersetzungen und deutsche Beschriftung aus dem Review von #370\nAdmin-Oberfläche (src-admin): Pakete aktualisiert (React 19.3, MUI 9.6, json-config 10, marked 18) und neu gebaut\nRepository-Checker: Testpakete kommen jetzt aus @iobroker/testing, @iobroker/adapter-dev und .vscode/settings.json hinzugefügt\nTimer nutzen adapter.setTimeout()/clearTimeout() und werden beim Stoppen der Instanz gelöscht\nAdmin-Übersetzungen im kurzen i18n-Format (admin/i18n/{lang}.json)\nAdmin: Die Einstellungen nutzen die volle Seitenhöhe (gemessen statt fester Abstand)",
22
+ "ru": "Обновленные пакеты (axios, cron-parser 5 и другие)\nАдминистратор: пользовательский интерфейс JSONConfig (заменяет Materialize `index_m`) шлюзом VerifyConfig (адреса #309)\nПерезапись цели зоны: принимайте устаревшие строковые значения во время выполнения (`\"95\"` или `{val, delay}`)\nДокумент, в котором в именах триггеров можно использовать точки в качестве групповых папок в зонах (адреса #22)\nОпциональная перепроверка состояния триггера и зоны после задержки включения зоны (адреса #4)\nСправка: совет, как отправлять уведомления через состояния мессенджера (исправление #6)\nДобавлены переводы на украинский язык (Великобритания) для io-package.json и admin (#368)\nАдминистратор: колонка recheck-after-delay в виде значка со всплывающей подсказкой; i18n и немецкий лейбл из обзора #370\nПользовательский интерфейс администратора (src-admin): обновлены пакеты (React 19.3, MUI 9.6, json-config 10, помечено как 18) и перестроен пакет\nПроверка репозитория: тестовые пакеты теперь поступают из @iobroker /testing, добавлены @iobroker /adapter-dev и .vscode/settings.json\nТаймеры используют Adapter.setTimeout () /clearTimeout (), поэтому они очищаются при остановке экземпляра\nПереводы администраторов перенесены в короткий формат i18n (admin/i18n/ {lang} .json)\nAdmin: в настройках используется полная высота страницы (измеренная вместо фиксированного смещения)",
23
+ "pt": "Pacotes atualizados (axios, cron-parser 5 e outros)\nAdmin: JSONConfig UI (substitui Materialize `index_m`) por verifyConfig gate (endereços #309)\nSubstituir alvo de zona: aceite valores de string legados (`\"95\"` ou `{val, delay}`)\nDocumentos que acionam nomes podem usar pontos em pastas em zonas (endereços #22)\nVerificação opcional das condições do gatilho e da zona após atraso (endereços #4)\nAjuda: dica para enviar notificações via messenger (correções #6)\nAdicionadas traduções em ucraniano para io-package.json e admin (#368)\nAdmin: coluna recheck after-delay como ícone com tooltip; i18n e rótulo alemão da #370 review\nAdmin UI (src-admin): atualizou pacotes (React 19.3, MUI 9.6, json-config 10, marked 18) e reconstruiu o pacote\nRepository checker: pacotes de teste agora vêm de @iobroker /testing, com @iobroker /adapter-dev e .vscode/settings.json\nOs timers usam Adapter.setTimeout () /clearTimeout () e são apagados quando a instância para\nTraduções de admin movidas para o formato i18n curto (admin/i18n/ {lang} .json)\nAdmin: as configurações usam a altura total da página (medida em vez de fixar)",
24
+ "nl": "Bijgewerkte pakketten (axios, cron-parser 5 en andere)\nAdmin: JSONConfig UI (vervangt Materialize `index_m`) door VerifyConfig gate (adressen #309)\nOverschrijven van zonedoel: accepteer oude tekenreekswaarden tijdens runtime (`\"95\"` of `{val, delay}`)\nDocument dat namen activeert, kan punten gebruiken als groepsmappen in zones (adressen #22)\nOptionele hercontrole van de trigger- en zonecondities na ingeschakelde zone (adressen #4)\nHelp: tip voor het verzenden van meldingen via Messenger-staten (oplossingen #6)\nOekraïense (Britse) vertalingen toegevoegd voor io-package.json en admin (#368)\nAdmin: kolom recheck-after delay als icoon met tooltip; i18n en Duits label uit de #370 review\nGebruikersinterface voor beheerders (src-admin): pakketten bijgewerkt (React 19.3, MUI 9.6, json-config 10, gemarkeerd met 18) en de bundel opnieuw opgebouwd\nRepository checker: testpakketten zijn nu afkomstig van @iobroker /testing, ik heb @iobroker /adapter-dev en .vscode/settings.json toegevoegd\nTimers gebruiken Adapter.setTimeout () /clearTimeout (), zodat ze worden gewist wanneer de instance stopt\nVertalingen voor beheerders zijn verplaatst naar het korte i18n-formaat (admin/i18n/ {lang} .json)\nAdmin: de instellingen gebruiken de volledige hoogte van de pagina (gemeten in plaats van een vaste offset)",
25
+ "fr": "Paquets mis à jour (axios, cron-parser 5 et autres)\nAdmin : JSONConfig UI (remplace Materialize « index_m ») par VerifyConfig Gate (addresses #309)\nRemplacer la cible de la zone : accepte les anciennes chaînes au moment de l'exécution (« 95 » ou « {val, delay} »)\nDocument qui peut utiliser des points comme dossiers de groupe dans les zones (adresses #22)\nRecontrôle facultatif du déclenchement et de l'état de la zone après le report (adresses #4)\nAide : astuce pour envoyer des notifications via Messenger (fixes #6)\nAjout des traductions en ukrainien pour io-package.json et admin (#368)\nAdmin : colonne Recheck-afterdelay avec info-bulle ; i18n et label allemand tiré de #370 review\nInterface utilisateur (src-admin) : packages mis à jour (React 19.3, MUI 9.6, json-config 10, marqué 18) et reconstruit le bundle\nVérificateur de dépôts : les packages de test viennent de @iobroker /testing, @iobroker /adapter-dev et .vscode/settings.json\nLes timers utilisent Adapter.setTimeout () /clearTimeout () et sont effacés à l'arrêt de l'instance\nAdmin Translations est passé au format court i18n (admin/i18n/ {lang} .json)\nAdmin : les paramètres utilisent toute la hauteur de la page (mesurée au lieu d'un décalage fixe)",
26
+ "it": "Pacchetti aggiornati (axios, cron-parser 5 e altri)\nAdmin: JsonConfig UI (sostituisce `index_m`) con VerifyConfig gate (indirizzi #309)\nSovrascrittura zona target: accetta stringhe legacy in fase di esecuzione («95\" o {val, delay})\nI nomi dei documenti possono usare punti per raggruppare le zone (indirizzi #22)\nRicontrollo opzionale del trigger e della zona dopo il ritardo (indirizzi #4)\nAiuto: suggerimento su come inviare notifiche via Messenger (fix #6)\nAggiunte traduzioni in ucraino per io-package.json e admin (#368)\nAdmin: riprova dopo il ritardo come icona con tooltip; i18n ed etichetta tedesca da #370\nAdmin UI (src-admin): pacchetti aggiornati (React 19.3, MUI 9.6, json-config 10, 18) e ricostruito\nRepository Checker: i pacchetti di test ora provengono da @iobroker /testing, @iobroker /adapter-dev e .vscode/settings.json\nI timer usano adapter.setTimeout () /clearTimeout () e vengono cancellati\nLe traduzioni admin sono passate al breve i18n (admin/i18n/ {lang} .json)\nAdmin: usa l'intera altezza della pagina (anziché un offset fisso)",
27
+ "es": "Paquetes actualizados (axios, cron-parser 5 y otros)\nAdmin: JsonConfig UI (sustituye Materialize `index_m`) por VerifyConfig gate (address #309)\nSobrescritura de objetivos de zona: acepte valores de cadena heredados en tiempo de ejecución (`\"95\" o `{val, delay}`)\nEl documento que activa nombres puede usar puntos como carpetas de grupo en las zonas (direcciones #22)\nVuelva a comprobar las condiciones de activación y zona tras el retraso de la zona (direcciones #4)\nAyuda: consejos sobre cómo enviar notificaciones por Messenger (fix #6)\nSe han añadido traducciones al ucraniano (UK) para io-package.json y admin (#368)\nAdmin: volver a comprobar después del retraso como icono con ayuda; i18n y etiqueta alemana de #370 review\nAdmin UI (src-admin): actualizó los paquetes (React 19.3, MUI 9.6, json-config 10, marcado 18) y reconstruyó el paquete\nComprobador de repositorios: los paquetes de prueba vienen ahora de @iobroker /testing, se añaden @iobroker /adapter-dev y .vscode/settings.json\nLos temporizadores usan Adapter.setTimeout () /clearTimeout () y se borran cuando la instancia se detiene\nLas traducciones administrativas pasaron al formato i18n corto (admin/i18n/ {lang} .json)\nAdmin: la configuración usa la altura total de la página (medida en lugar de un desfase fijo)",
28
+ "pl": "Zaktualizowane pakiety (axios, cron-parser 5 i inne)\nAdministrator: JSONConfig UI (zastępuje Materialize `index_m`) bramką VerifyConfig (adresy #309)\nNadpisanie docelowego strefy: akceptuj starsze wartości ciągu w czasie wykonywania (`\"95\"` lub `{val, delay}`)\nDokument wywołujący nazwy może używać kropek jako folderów grupowych w strefach (adresy #22)\nOpcjonalne ponowne sprawdzenie warunków wyzwalania i strefy po opóźnieniu w strefie (adresy #4)\nPomoc: wskazówka, jak wysyłać powiadomienia za pośrednictwem stanów komunikatora (poprawki #6)\nDodano tłumaczenia ukraińskie (brytyjskie) dla io-package.json i admin (#368)\nAdministrator: ponownie sprawdź kolumnę po opóźnieniu jako ikonę z podpowiedzką; i18n i niemiecka etykieta z recenzji #370\nAdministrator UI (src-admin): zaktualizowano pakiety (React 19.3, MUI 9.6, json-config 10, oznaczone 18) i przebudowano pakiet\nKontroler repozytorium: pakiety testowe pochodzą teraz z @iobroker /testing, dodano @iobroker /adapter-dev i .vscode/settings.json\nTimery używają adapter.setTimeout () /clearTimeout (), więc są usuwane po zatrzymaniu instancji\nTłumaczenia administratora przeniesione do krótkiego formatu i18n (admin/i18n/ {lang} .json)\nAdministrator: ustawienia wykorzystują pełną wysokość strony (mierzona zamiast stałego przesunięcia)",
29
+ "uk": "Оновлені пакети (axios, крон-парсер 5 та інші)\nАдміністратор: інтерфейс JsonConfig (замінює матеріалізацію `index_m`) за допомогою шлюзу VerifyConfig (адреси #309)\nПерезапис цільової зони: приймайте застарілі значення рядків під час виконання (`\"95\"` або `{val, delay}`)\nДокумент, який викликає імена, може використовувати крапки як групові папки в зонях (адреси #22)\nНеобов'язкова повторна перевірка умов тригера та зони після затримки зони (адреси #4)\nДовідка: порада, як надсилати сповіщення через стани месенджера (виправлення #6)\nДодано українські (uk) переклади для io-package.json та admin (#368)\nАдміністратор: повторна перевірка стовпця після затримки як піктограма з підказкою; i18n та німецька мітка з огляду #370\nІнтерфейс адміністратора (src-admin): оновлені пакети (React 19.3, MUI 9.6, json-config 10, позначено 18) та перебудовано пакет\nПеревірка сховища: тестові пакети тепер надходять з @iobroker /testing, додано @iobroker /адапter-dev та .vscode/settings.json\nТаймери використовують Adapter.setTimeout () /clearTimeOut (), тому вони очищаються, коли екземпляр зупиняється\nПереклади адміністратора переміщені в короткий формат i18n (admin/i18n/ {lang} .json)\nАдміністратор: в налаштуваннях використовується повна висота сторінки (вимірюється замість фіксованого зміщення)",
30
+ "zh-cn": "更新后的软件包(axios、cron-parser 5 等)\n管理员:使用 VerifyConfig 门将 JsonConfig UI(替换 Materialize `index_m`)(地址 #309)\n区域目标覆盖:在运行时接受旧字符串值(``95\"` 或 `{val,delay}`)\n触发名称的文档可以使用点作为区域中的群组文件夹 (地址 #22)\n区域接通延迟后可选地重新检查触发器和区域条件(地址 #4)\n帮助:提示如何通过信使状态发送通知(修复 #6)\n为 io-package.json 和 admin 添加了乌克兰语(英国)翻译 (#368)\n管理员:延迟后重新检查列为带有工具提示的图标;来自 #370 评论的 i18n 和德国标签\n管理界面 (src-admin):更新了软件包(React 19.3、MUI 9.6、json-config 10,标记为 18)并重建了软件包\n存储库检查器:测试包现在来自 @iobroker /testing,添加了 @iobroker /adapter-dev 和 .vscode/settings.json\n计时器使用 Adapter.setTimeout () /clearTimeOut (),因此它们会在实例停止时被清除\n管理员翻译改为简短的 i18n 格式(admin/i18n/ {lang} .json)\n管理员:设置使用页面的全高(测量而非固定偏移量)"
31
+ },
6
32
  "2.1.0": {
7
33
  "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
34
  "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",
@@ -67,31 +93,6 @@
67
93
  "pl": "usunąć błędy i ostrzeżenia podczas wdrożenia\nkomentarze do stref",
68
94
  "uk": "видалення помилок і попереджень, що виникли під час розгортання\nкоментар до зон",
69
95
  "zh-cn": "在部署期间消除错误和警告\n对区域的评论"
70
- },
71
- "1.2.2": {
72
- "en": "migration to links in iobroker-community-adapters\nupdate due to open PR of original repo\nnode testing to 12, 14, 16",
73
- "de": "migration auf links in iobroker-community-adapter\naktualisierung aufgrund der offenen PR des Originalrepo\nknotentests auf 12, 14, 16",
74
- "ru": "миграция по ссылкам в iobroker-community-adapters\nобновление из-за открытого PR оригинального репо\nпроверка узлов до 12, 14, 16",
75
- "pt": "migração para links em iobroker-community-adapters\natualização devido ao PR aberto da repo original\ntestes de nó para 12, 14, 16",
76
- "nl": "migration tolinks in iobroker-community-apters\nvertaling:\nnode testen tot 12, 14, 16",
77
- "fr": "migration vers des liens dans les adaptateurs iobroker-community\nmise à jour en raison de l'ouverture de PR de la reprise originale\nessai node à 12, 14, 16",
78
- "it": "migrazione ai collegamenti in iobroker-community-adapters\naggiornamento a causa di open PR di repo originale\ntest di nodo a 12, 14, 16",
79
- "es": "migraciones a enlaces en iobroker-community-adapters\nactualización debido a PR abierto de reposo original\na 12, 14, 16",
80
- "pl": "migracja połączy się w iobroker-kommunity-adapter\nzaktualizowana z powodu otwartej części Repo\ntesty węzłów: 12, 16",
81
- "uk": "міграції посилань на iobroker-community-adapters\nоновлення через відкритий PR оригінальної репо\nтестування вузлів до 12, 14, 16",
82
- "zh-cn": "移徙与奥罗布克-community-adapters之间的联系\n由于对原状进行公开审查,更新\n对12、14、16"
83
- },
84
- "1.2.1": {
85
- "en": "Enhancement: Now, all adapter config validations take place while saving the adapter configuration, and all identified errors are shown in a dialog. Addresses issue #61",
86
- "de": "Erweiterung: Jetzt finden alle Überprüfungen der Adapterkonfiguration statt, während die Adapterkonfiguration gespeichert wird, und alle identifizierten Fehler werden in einem Dialogfeld angezeigt. Behebt das Problem Nr. 61",
87
- "ru": "Улучшение: теперь все проверки конфигурации адаптера происходят при сохранении конфигурации адаптера, и все выявленные ошибки отображаются в диалоговом окне. Решает проблему №61.",
88
- "pt": "Aprimoramento: agora, todas as validações de configuração do adaptador ocorrem ao salvar a configuração do adaptador e todos os erros identificados são mostrados em um diálogo. Resolve o problema # 61",
89
- "nl": "Verbetering: nu vinden alle adapterconfiguratie-validaties plaats tijdens het opslaan van de adapterconfiguratie en worden alle geïdentificeerde fouten in een dialoogvenster weergegeven. Lost probleem # 61 op",
90
- "fr": "Amélioration: Désormais, toutes les validations de configuration de l'adaptateur ont lieu lors de l'enregistrement de la configuration de l'adaptateur, et toutes les erreurs identifiées sont affichées dans une boîte de dialogue. Résolution du problème n ° 61",
91
- "it": "Miglioramento: ora, tutte le convalide della configurazione dell'adattatore vengono eseguite durante il salvataggio della configurazione dell'adattatore e tutti gli errori identificati vengono visualizzati in una finestra di dialogo. Risolve il problema # 61",
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",
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",
94
- "zh-cn": "增强功能:现在,所有适配器配置验证都在保存适配器配置的同时进行,并且所有已识别的错误均显示在对话框中。解决了问题61"
95
96
  }
96
97
  },
97
98
  "titleLang": {
@@ -104,6 +105,7 @@
104
105
  "it": "Smart Control",
105
106
  "es": "Smart Control",
106
107
  "pl": "Smart Control",
108
+ "uk": "Smart Control",
107
109
  "zh-cn": "Smart Control"
108
110
  },
109
111
  "desc": {
@@ -116,6 +118,7 @@
116
118
  "it": "Controlla i dispositivi in ​​modo più intelligente: raggruppando, inclusi trigger come movimento, apertura della finestra, ecc. E imposta i dispositivi di destinazione di conseguenza",
117
119
  "es": "Controle los dispositivos de manera más inteligente: agrupando, incluidos los desencadenantes como el movimiento, la ventana de apertura, etc.",
118
120
  "pl": "Inteligentniejsze sterowanie urządzeniami: przez grupowanie, w tym wyzwalaczy, takich jak ruch, otwieranie okna itp. I odpowiednie ustawianie urządzeń docelowych",
121
+ "uk": "Керуйте пристроями розумніше: за допомогою групування, з урахуванням тригерів, як-от рух, відчинення вікна тощо, і відповідного налаштування цільових пристроїв",
119
122
  "zh-cn": "控制设备更智能:通过分组(包括动作,打开窗口等)进行分组,并相应地设置目标设备"
120
123
  },
121
124
  "authors": [
@@ -169,7 +172,7 @@
169
172
  }
170
173
  ],
171
174
  "adminUI": {
172
- "config": "materialize"
175
+ "config": "json"
173
176
  }
174
177
  },
175
178
  "native": {
package/lib/helper.js CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ const nodeTimers = require('node:timers');
4
+
3
5
  /**
4
6
  * @param adapter
5
7
  * @description Generic Helper Functions
@@ -74,10 +76,12 @@ module.exports = function (adapter) {
74
76
  initialDefault = {};
75
77
  }
76
78
  }
79
+ // Default nach create ist Adapter-Wert, nicht Nutzer-Befehl.
80
+ // write:false (z. B. options.*.name) + ack:false -> js-controller-Warnung.
77
81
  if (isForeign) {
78
- await adapter.setForeignStateAsync(lpStateToCreate.statePath, initialDefault, false);
82
+ await adapter.setForeignStateAsync(lpStateToCreate.statePath, initialDefault, true);
79
83
  } else {
80
- await adapter.setStateAsync(lpStateToCreate.statePath, initialDefault, false);
84
+ await adapter.setStateAsync(lpStateToCreate.statePath, initialDefault, true);
81
85
  }
82
86
  adapter.log.debug(`State '${lpStateToCreate.statePath}' created.`);
83
87
  }
@@ -567,9 +571,12 @@ module.exports = function (adapter) {
567
571
  return -1;
568
572
  }
569
573
 
570
- const dummyTimer = setTimeout(() => {}, 0); // We need a dummy timer to get the current number of ms when the node.js session was started
571
- const currMsAfterNodeJsStart = dummyTimer['_idleStart']; // _idleStart is the number of milliseconds since the node.js session was started.
572
- clearTimeout(dummyTimer); // clear dummy timer, just in case.
574
+ // A native dummy timer only to read the current libuv time (_idleStart, ms since the node.js session was started).
575
+ // It is cleared at once, so it cannot outlive the adapter. adapter.setTimeout() is not used on purpose:
576
+ // this is also called in onUnload(), where adapter.setTimeout() returns undefined and logs a warning.
577
+ const dummyTimer = nodeTimers.setTimeout(() => {}, 0);
578
+ const currMsAfterNodeJsStart = dummyTimer['_idleStart'];
579
+ nodeTimers.clearTimeout(dummyTimer);
573
580
 
574
581
  const elapsed = currMsAfterNodeJsStart - timerId._idleStart; // for how many milliseconds is timer already running?
575
582
  let remaining = timerId._idleTimeout - elapsed; // remaining time in ms
@@ -946,12 +953,39 @@ module.exports = function (adapter) {
946
953
  * Converts string like 'val:'abc', delay:500' to a JSON object
947
954
  * If keys 'val' or 'delay' are not existing, return {val: query}
948
955
  *
949
- * @param {string} query
956
+ * jsonConfig speichert denselben Override schon als Objekt { val, delay }.
957
+ * Die alte Admin-UI speicherte nur den String ("95"). Beides muss hier landen.
958
+ *
959
+ * @param {string|object} query
950
960
  * @param {Array} keys - array of strings like ['val', 'delay']
951
961
  * @param {boolean} [flat]
952
962
  * @returns {object|null} JSON object, or null if query is empty or errors
953
963
  */
954
964
  convertStrToJson(query, keys, flat = false) {
965
+ if (query && typeof query === 'object' && !Array.isArray(query)) {
966
+ const out = {};
967
+ if (query.val !== undefined && query.val !== null && String(query.val).trim() !== '') {
968
+ out.val = query.val;
969
+ }
970
+ if (
971
+ query.delay !== undefined &&
972
+ query.delay !== null &&
973
+ query.delay !== '' &&
974
+ this.isNumber(query.delay) &&
975
+ parseInt(query.delay) >= 0
976
+ ) {
977
+ out.delay = query.delay;
978
+ }
979
+ return Object.keys(out).length ? out : null;
980
+ }
981
+
982
+ if (typeof query !== 'string') {
983
+ if (query === undefined || query === null) {
984
+ return null;
985
+ }
986
+ query = String(query);
987
+ }
988
+
955
989
  if (this.isLikeEmpty(query)) {
956
990
  return null;
957
991
  }
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const { getOtherMotionTriggerNames, zoneMotionOffTimerAction } = require('./motion-zone-timer');
4
+ const { isTriggerStateMatching, isRecheckAfterDelayEnabled, shouldRecheckTriggerState } = require('./trigger-match');
4
5
 
5
6
  /**
6
7
  * @description For handling of triggers and their associated target devices.
@@ -154,7 +155,7 @@ class Trigger {
154
155
 
155
156
  // Timer zoneOn (delay for switching zone on)
156
157
  for (const lpZoneName of this.zoneNames) {
157
- clearTimeout(this.adapter.x.timersZoneOn[lpZoneName]);
158
+ this.adapter.clearTimeout(this.adapter.x.timersZoneOn[lpZoneName]);
158
159
  this.adapter.x.timersZoneOn[lpZoneName] = null;
159
160
  const zoneOnSecs = parseInt(
160
161
  this.adapter.getOptionTableValue('tableZones', 'name', lpZoneName, 'onAfter'),
@@ -165,8 +166,9 @@ class Trigger {
165
166
  );
166
167
  this._asyncSetTargetDevices_processZone(lpZoneName);
167
168
  } else {
168
- this.adapter.x.timersZoneOn[lpZoneName] = setTimeout(() => {
169
- this._asyncSetTargetDevices_processZone(lpZoneName);
169
+ // Nach der Wartezeit: nur prüfen, wenn die Zone das opt-in gesetzt hat.
170
+ this.adapter.x.timersZoneOn[lpZoneName] = this.adapter.setTimeout(() => {
171
+ this._asyncActivateZoneAfterOnDelay(lpZoneName);
170
172
  }, zoneOnSecs * 1000);
171
173
  }
172
174
  }
@@ -175,6 +177,154 @@ class Trigger {
175
177
  }
176
178
  }
177
179
 
180
+ /**
181
+ * Zone-Einschaltverzögerung ist abgelaufen.
182
+ *
183
+ * Warum (#4 / Review #370): Standard wie früher immer schalten. Nur wenn
184
+ * die Zone „Recheck after delay“ an hat, nochmal Auslöser/Bedingungen prüfen.
185
+ *
186
+ * @param {string} zoneName
187
+ */
188
+ async _asyncActivateZoneAfterOnDelay(zoneName) {
189
+ try {
190
+ this.adapter.x.timersZoneOn[zoneName] = null;
191
+ const recheckOn = isRecheckAfterDelayEnabled(
192
+ this.adapter.getOptionTableValue('tableZones', 'name', zoneName, 'recheckAfterDelay'),
193
+ );
194
+ if (recheckOn) {
195
+ const stillOk = await this._asyncRecheckAfterOnDelay(zoneName);
196
+ if (!stillOk) {
197
+ this.adapter.log.debug(
198
+ `Trigger [${this.triggerName}] Zone '${zoneName}': delay elapsed, but trigger or conditions no longer match – skip switching on.`,
199
+ );
200
+ return;
201
+ }
202
+ }
203
+ await this._asyncSetTargetDevices_processZone(zoneName);
204
+ } catch (error) {
205
+ this.adapter.x.helper.dumpError('[_asyncActivateZoneAfterOnDelay]', error);
206
+ }
207
+ }
208
+
209
+ /**
210
+ * Nochmal: Auslöser-Datenpunkt + Zonen-Ausführung (und bei Zeit: Zusatzbedingungen).
211
+ *
212
+ * @param {string} zoneName
213
+ * @returns {Promise<boolean>}
214
+ */
215
+ async _asyncRecheckAfterOnDelay(zoneName) {
216
+ try {
217
+ if (this.triggerIsTime) {
218
+ let doContinue = await this.asyncAreScheduleConditionsMet(
219
+ 'Trigger: Additional Conditions (recheck after delay)',
220
+ this.triggerTmAdditionCond,
221
+ this.triggerTmAddCondAll,
222
+ );
223
+ if (doContinue) {
224
+ doContinue = await this.asyncAreScheduleConditionsMet(
225
+ 'Trigger: "Never if" Conditions (recheck after delay)',
226
+ this.triggerTmNever,
227
+ this.triggerTmNeverAll,
228
+ true,
229
+ );
230
+ }
231
+ if (!doContinue) {
232
+ return false;
233
+ }
234
+ } else if (shouldRecheckTriggerState(this) && this.triggerStatePath) {
235
+ const stateObject = await this.adapter.x.helper.asyncGetForeignState(this.triggerStatePath);
236
+ if (!stateObject) {
237
+ return false;
238
+ }
239
+ if (!isTriggerStateMatching(stateObject.val, this.triggerStateVal, this.triggerTableId)) {
240
+ this.adapter.log.debug(
241
+ `Trigger [${this.triggerName}] Zone '${zoneName}': current value '${stateObject.val}' no longer matches '${this.triggerStateVal}'.`,
242
+ );
243
+ return false;
244
+ }
245
+ }
246
+
247
+ const zoneRow = (this.adapter.config.tableZones || []).find(
248
+ lpRow => lpRow.active && lpRow.name === zoneName,
249
+ );
250
+ if (!zoneRow || !Array.isArray(zoneRow.triggers) || !zoneRow.triggers.includes(this.triggerName)) {
251
+ return false;
252
+ }
253
+ return await this._asyncIsZoneExecutionCurrentlyMet(zoneRow);
254
+ } catch (error) {
255
+ this.adapter.x.helper.dumpError('[_asyncRecheckAfterOnDelay]', error);
256
+ return false;
257
+ }
258
+ }
259
+
260
+ /**
261
+ * Gilt die Ausführungs-Tabelle der Zone jetzt noch? (Uhrzeit, Wochentag, Bedingungen)
262
+ *
263
+ * @param {object} lpRowZones eine Zeile aus tableZones
264
+ * @returns {Promise<boolean>}
265
+ */
266
+ async _asyncIsZoneExecutionCurrentlyMet(lpRowZones) {
267
+ const executeAlways = lpRowZones.executeAlways ? true : false;
268
+ let tablesZoneExecution = [];
269
+ if (executeAlways) {
270
+ tablesZoneExecution = [{ active: true, executeAlways: true }];
271
+ } else {
272
+ tablesZoneExecution = lpRowZones.executionJson ? JSON.parse(lpRowZones.executionJson) : [];
273
+ }
274
+
275
+ for (const lpRow of tablesZoneExecution) {
276
+ if (lpRow.active && (await this._asyncDoesExecutionRowMatch(lpRowZones, lpRow))) {
277
+ return true;
278
+ }
279
+ }
280
+ return false;
281
+ }
282
+
283
+ /**
284
+ * Eine Zeile der Zonen-Ausführung (Zeitfenster, Tage, Bedingungen).
285
+ *
286
+ * @param {object} lpRowZones
287
+ * @param {object} lpRow
288
+ * @returns {Promise<boolean>}
289
+ */
290
+ async _asyncDoesExecutionRowMatch(lpRowZones, lpRow) {
291
+ this.adapter.log.debug(`Trigger [${this.triggerName}] === check schedule conditions ===`);
292
+
293
+ if (lpRow.executeAlways) {
294
+ this.adapter.log.debug(
295
+ `Trigger [${this.triggerName}] Zone '${lpRowZones.name}' - 'Execute always is activated, so continue'`,
296
+ );
297
+ return true;
298
+ }
299
+
300
+ const tsCurrent = Date.now();
301
+ let doContinue = this.adapter.x.helper.scheduleIsTimeStampWithinPeriod(
302
+ tsCurrent,
303
+ lpRow.start,
304
+ lpRow.end,
305
+ lpRowZones.name,
306
+ );
307
+ if (doContinue) {
308
+ doContinue = this.adapter.x.helper.scheduleIsWeekdayMatching(lpRow, tsCurrent, lpRowZones.name);
309
+ }
310
+ if (doContinue) {
311
+ doContinue = await this.asyncAreScheduleConditionsMet(
312
+ 'Zone Execution: Additional Conditions',
313
+ lpRow.additionalConditions,
314
+ lpRow.additionalConditionsAll,
315
+ );
316
+ }
317
+ if (doContinue) {
318
+ doContinue = await this.asyncAreScheduleConditionsMet(
319
+ 'Zone Execution: "never if" Conditions',
320
+ lpRow.never,
321
+ lpRow.neverAll,
322
+ true,
323
+ );
324
+ }
325
+ return doContinue;
326
+ }
327
+
178
328
  /**
179
329
  * Set all target devices: Process zone - Start
180
330
  *
@@ -256,7 +406,7 @@ class Trigger {
256
406
 
257
407
  // Clear "linked devices" (mimic motion) timer for motion trigger
258
408
  if (this.triggerIsMotion && timeLeft > -1) {
259
- clearTimeout(this.adapter.x.timersMimicMotionTrigger[zoneName]);
409
+ this.adapter.clearTimeout(this.adapter.x.timersMimicMotionTrigger[zoneName]);
260
410
  this.adapter.x.timersMimicMotionTrigger[zoneName] = null;
261
411
  this.adapter.log.debug(
262
412
  `Clearing timer 'Linked device to motion', which was still running for ${(timeLeft / 1000).toFixed(0)} seconds.`,
@@ -297,18 +447,24 @@ class Trigger {
297
447
  }
298
448
  lDelaySecs.push(delay);
299
449
 
300
- // Targets overwrite: state value, and delay
450
+ // Targets overwrite: alte UI speicherte oft nur den String ("95"),
451
+ // jsonConfig/verify { val, delay }. Beides muss zur Laufzeit greifen.
301
452
  let overwriteValue = null;
302
453
  if (targetsOverwrite && targetsOverwrite[lpTargetDeviceName]) {
303
- if (!this.adapter.x.helper.isLikeEmpty(targetsOverwrite[lpTargetDeviceName].val)) {
304
- overwriteValue = targetsOverwrite[lpTargetDeviceName].val;
454
+ const ow = this.adapter.x.helper.convertStrToJson(targetsOverwrite[lpTargetDeviceName], [
455
+ 'val',
456
+ 'delay',
457
+ ]);
458
+ if (ow && !this.adapter.x.helper.isLikeEmpty(ow.val)) {
459
+ overwriteValue = ow.val;
305
460
  }
306
461
  if (
307
- targetsOverwrite[lpTargetDeviceName].delay !== undefined &&
308
- this.adapter.x.helper.isNumber(targetsOverwrite[lpTargetDeviceName].delay) &&
309
- parseInt(targetsOverwrite[lpTargetDeviceName].delay) > -1
462
+ ow &&
463
+ ow.delay !== undefined &&
464
+ this.adapter.x.helper.isNumber(ow.delay) &&
465
+ parseInt(ow.delay) > -1
310
466
  ) {
311
- delay = parseInt(targetsOverwrite[lpTargetDeviceName].delay);
467
+ delay = parseInt(ow.delay);
312
468
  }
313
469
  }
314
470
 
@@ -319,14 +475,15 @@ class Trigger {
319
475
  if (delay > 0) {
320
476
  lDelayedDevices.push(lpTargetDeviceName);
321
477
  }
322
- clearTimeout(this.adapter.x.timersZoneDeviceOnDelay[`${zoneName}_${lpTargetDeviceName}`]);
478
+ this.adapter.clearTimeout(this.adapter.x.timersZoneDeviceOnDelay[`${zoneName}_${lpTargetDeviceName}`]);
323
479
  this.adapter.x.timersZoneDeviceOnDelay[`${zoneName}_${lpTargetDeviceName}`] = null;
324
480
 
325
481
  if (delay > 0) {
326
482
  // set timeout
327
- this.adapter.x.timersZoneDeviceOnDelay[`${zoneName}_${lpTargetDeviceName}`] = setTimeout(() => {
328
- switchTargetDeviceAsync(this);
329
- }, delay * 1000);
483
+ this.adapter.x.timersZoneDeviceOnDelay[`${zoneName}_${lpTargetDeviceName}`] =
484
+ this.adapter.setTimeout(() => {
485
+ switchTargetDeviceAsync(this);
486
+ }, delay * 1000);
330
487
  } else {
331
488
  // call right away
332
489
  await switchTargetDeviceAsync(this);
@@ -513,7 +670,7 @@ class Trigger {
513
670
  that.adapter.log.debug(
514
671
  `Trigger [${that.triggerName}] Zone '${zoneName}': Turn off 'always off' timer, since still running ${(zoneOffTimeLeft / 1000).toFixed(0)} seconds and toggle trigger triggered to turn off.`,
515
672
  );
516
- clearTimeout(that.adapter.x.timersZoneOff[zoneName]);
673
+ that.adapter.clearTimeout(that.adapter.x.timersZoneOff[zoneName]);
517
674
  that.adapter.x.timersZoneOff[zoneName] = null;
518
675
  }
519
676
  } else {
@@ -629,12 +786,12 @@ class Trigger {
629
786
  // First: clear timers. Note: we use timeLeft since we need this anyways for log.
630
787
  const timeLeft = this.adapter.x.helper.getTimeoutTimeLeft(this.adapter.x[timerObjectKey][zoneName]);
631
788
  if (timeLeft > -1) {
632
- clearTimeout(this.adapter.x[timerObjectKey][zoneName]);
789
+ this.adapter.clearTimeout(this.adapter.x[timerObjectKey][zoneName]);
633
790
  this.adapter.x[timerObjectKey][zoneName] = null;
634
791
  }
635
792
 
636
793
  // Set timer
637
- this.adapter.x[timerObjectKey][zoneName] = setTimeout(() => {
794
+ this.adapter.x[timerObjectKey][zoneName] = this.adapter.setTimeout(() => {
638
795
  this._asyncSetZoneTimer_doOnTimeout(zoneName, timerObjectKey, targets, zoneOffAfter);
639
796
  }, zoneOffAfter * 1000);
640
797
 
@@ -695,7 +852,7 @@ class Trigger {
695
852
  }
696
853
 
697
854
  // Set timer
698
- this.adapter.x.timersMotionOff[zoneName] = setTimeout(() => {
855
+ this.adapter.x.timersMotionOff[zoneName] = this.adapter.setTimeout(() => {
699
856
  if (!this.motionDuration) {
700
857
  return;
701
858
  }
@@ -717,7 +874,7 @@ class Trigger {
717
874
  */
718
875
  _clearZoneMotionOffTimer(zoneName) {
719
876
  if (this.adapter.x.timersMotionOff[zoneName]) {
720
- clearTimeout(this.adapter.x.timersMotionOff[zoneName]);
877
+ this.adapter.clearTimeout(this.adapter.x.timersMotionOff[zoneName]);
721
878
  this.adapter.x.timersMotionOff[zoneName] = null;
722
879
  }
723
880
  }
@@ -928,68 +1085,16 @@ class Trigger {
928
1085
 
929
1086
  for (const lpRow of tablesZoneExecution) {
930
1087
  if (lpRow.active) {
931
- this.adapter.log.debug(`Trigger [${this.triggerName}] === check schedule conditions ===`);
932
-
933
- if (lpRow.executeAlways) {
1088
+ const doContinue = await this._asyncDoesExecutionRowMatch(lpRowZones, lpRow);
1089
+ if (doContinue) {
934
1090
  this.adapter.log.debug(
935
- `Trigger [${this.triggerName}] Zone '${lpRowZones.name}' - 'Execute always is activated, so continue'`,
1091
+ `Trigger [${this.triggerName}] Zone '${lpRowZones.name}' - execution table row *is* meeting conditions`,
936
1092
  );
937
1093
  this.zoneNames.push(lpRowZones.name);
938
1094
  } else {
939
- // A few variables / constants
940
- const tsCurrent = Date.now(); // the current timestamp
941
- let doContinue = true; // flag if we can continue.
942
-
943
- // First – check if current time is within the schedule times
944
- if (doContinue) {
945
- doContinue = this.adapter.x.helper.scheduleIsTimeStampWithinPeriod(
946
- tsCurrent,
947
- lpRow.start,
948
- lpRow.end,
949
- lpRowZones.name,
950
- );
951
- }
952
-
953
- // Next, check if current day is within the mon-sun options as set in schedules tables.
954
- if (doContinue) {
955
- doContinue = this.adapter.x.helper.scheduleIsWeekdayMatching(
956
- lpRow,
957
- tsCurrent,
958
- lpRowZones.name,
959
- );
960
- }
961
-
962
- // Next, check additional conditions (like Public Holiday, etc. -- as set in conditions table)
963
- if (doContinue) {
964
- doContinue = await this.asyncAreScheduleConditionsMet(
965
- 'Zone Execution: Additional Conditions',
966
- lpRow.additionalConditions,
967
- lpRow.additionalConditionsAll,
968
- );
969
- }
970
-
971
- // Next, check conditions "Never if"
972
- if (doContinue) {
973
- doContinue = await this.asyncAreScheduleConditionsMet(
974
- 'Zone Execution: "never if" Conditions',
975
- lpRow.never,
976
- lpRow.neverAll,
977
- true,
978
- );
979
- }
980
-
981
- // All checks done.
982
- if (doContinue) {
983
- this.adapter.log.debug(
984
- `Trigger [${this.triggerName}] Zone '${lpRowZones.name}' - execution table row *is* meeting conditions`,
985
- );
986
- /* isHit == true; */
987
- this.zoneNames.push(lpRowZones.name); // set matching zone name
988
- } else {
989
- this.adapter.log.debug(
990
- `Trigger [${this.triggerName}] Zone '${lpRowZones.name}' - execution table row is *not* meeting conditions`,
991
- );
992
- }
1095
+ this.adapter.log.debug(
1096
+ `Trigger [${this.triggerName}] Zone '${lpRowZones.name}' - execution table row is *not* meeting conditions`,
1097
+ );
993
1098
  }
994
1099
  }
995
1100
  }
@@ -1043,7 +1148,7 @@ class Trigger {
1043
1148
  for (const lpTimerObjId of timerObjIds) {
1044
1149
  const lpTimeLeft = this.adapter.x.helper.getTimeoutTimeLeft(this.adapter.x[lpTimerObjId][zoneName]);
1045
1150
  if (this.triggerIsMotion && lpTimeLeft > -1) {
1046
- clearTimeout(this.adapter.x[lpTimerObjId][zoneName]);
1151
+ this.adapter.clearTimeout(this.adapter.x[lpTimerObjId][zoneName]);
1047
1152
  this.adapter.x[lpTimerObjId][zoneName] = null;
1048
1153
  this.adapter.log.debug(
1049
1154
  `Trigger [${this.triggerName}] Zone '${zoneName}': Clearing timer '${lpTimerObjId}', which was still running for ${(lpTimeLeft / 1000).toFixed(0)} seconds.`,
@@ -1071,7 +1176,7 @@ class Trigger {
1071
1176
  this.adapter.x.zonesIsOn[zoneName] = false;
1072
1177
 
1073
1178
  // Clear timer 'timersZoneOn'
1074
- clearTimeout(this.adapter.x.timersZoneOn[zoneName]);
1179
+ this.adapter.clearTimeout(this.adapter.x.timersZoneOn[zoneName]);
1075
1180
  this.adapter.x.timersZoneOn[zoneName] = null;
1076
1181
 
1077
1182
  const lTargetDevicesSwitchedOff = []; // For Log