iobroker.autodarts 0.3.2 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -59,6 +59,9 @@ In the adapter settings, enter:
59
59
  <!--
60
60
  ### **WORK IN PROGRESS**
61
61
  -->
62
+ ### 0.3.3 (2025-12-27)
63
+ - Changed: Configuration fields interval and triggerReset now use seconds instead of milliseconds in the admin UI.
64
+
62
65
  ### 0.3.2 (2025-12-27)
63
66
  - (DrozmotiX) **ENHANCED**: Fixed all TypeScript type errors by adding proper type definitions for config properties
64
67
  - (DrozmotiX) **ENHANCED**: Refactored HTTP request handling - created reusable httpHelper module to eliminate code duplication
@@ -4,10 +4,10 @@
4
4
  "host_port": "Autodarts (Boardmanager) Port",
5
5
  "host_port_help": "Portnummer des lokalen Autodarts Boardmanagers.",
6
6
  "intro_txt": "Konfiguration des Autodarts-Adapters.",
7
- "polling": "Abfrageintervall (ms)",
8
- "polling_help": "Abfrageintervall in Millisekunden zum Abrufen von Daten vom Autodarts Boardmanager.",
9
- "reset": "Trigger-Reset (ms)",
10
- "reset_help": "Setzt den Triple- und Bullseye-Trigger nach x ms zurück (0 = kein Reset).",
7
+ "polling": "Abfrageintervall (s)",
8
+ "polling_help": "Abfrageintervall in Sekunden zum Abrufen von Daten vom Autodarts Boardmanager.",
9
+ "reset": "Trigger-Reset (s)",
10
+ "reset_help": "Setzt den Triple- und Bullseye-Trigger nach x Sekunden zurück (0 = kein Reset).",
11
11
  "triple_flag": "Minimales Feld für den Triple-Trigger",
12
12
  "triple_flag2": "Maximales Feld für den Triple-Trigger",
13
13
  "triple_flag2_help": "Feld „Maximale Punktzahl“ für den Triple-Trigger. Darts mit einer Punktzahl über diesem Wert lösen den Triple-Trigger-Datenpunkt nicht aus.",
@@ -4,12 +4,12 @@
4
4
  "host_port": "Autodarts (Boardmanager) Port",
5
5
  "host_port_help": "Port number of the local Autodarts Boardmanager.",
6
6
  "intro_txt": "Autodarts adapter configuration.",
7
- "polling": "Polling interval (ms)",
8
- "polling_help": "Polling interval in milliseconds to retrieve data from the Autodarts Boardmanager.",
7
+ "polling": "Polling interval (s)",
8
+ "polling_help": "Polling interval in seconds to retrieve data from the Autodarts Boardmanager.",
9
9
  "triple_flag": "Minimum field for the triple trigger",
10
10
  "triple_flag2": "Maximum field for the triple trigger",
11
11
  "triple_flag2_help": "Maximum score field for the triple trigger. Darts with a score above this value will not trigger the Triple-Trigger datapoint.",
12
12
  "triple_flag_help": "Minimum score field for the triple trigger. Darts with a score below this value will not trigger the Triple-Trigger datapoint.",
13
- "reset": "Trigger-Reset (ms)",
14
- "reset_help": "Reset the triple and bullseye trigger after x ms (0 = no reset)."
13
+ "reset": "Trigger-Reset (s)",
14
+ "reset_help": "Reset the triple and bullseye trigger after x seconds (0 = no reset)."
15
15
  }
@@ -4,10 +4,10 @@
4
4
  "host_port": "Puerto Autodarts (Boardmanager)",
5
5
  "host_port_help": "Número de puerto del administrador local de Autodarts Boardmanager.",
6
6
  "intro_txt": "Configuración del adaptador Autodarts.",
7
- "polling": "Intervalo de sondeo (ms)",
8
- "polling_help": "Intervalo de sondeo en milisegundos para recuperar datos del Autodarts Boardmanager.",
9
- "reset": "Restablecimiento del disparador (ms)",
10
- "reset_help": "Restablezca el disparador triple y de diana después de x ms (0 = sin reinicio).",
7
+ "polling": "Intervalo(s) de sondeo",
8
+ "polling_help": "Intervalo de sondeo en segundos para recuperar datos del Autodarts Boardmanager.",
9
+ "reset": "Restablecimiento de disparador (s)",
10
+ "reset_help": "Restablezca el disparador triple y de diana después de x segundos (0 = sin reinicio).",
11
11
  "triple_flag": "Campo mínimo para el triple disparador",
12
12
  "triple_flag2": "Campo máximo para el triple disparador",
13
13
  "triple_flag2_help": "Campo de puntuación máxima para el triple disparador. Los dardos con una puntuación superior a este valor no activarán el punto de datos Triple-Trigger.",
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "host_ip": "Autodarts (Boardmanager) Hôte/IP",
3
- "host_ip_help": "Adresse IP de l'Autodarts Boardmanager local.",
3
+ "host_ip_help": "Adresse IP du Boardmanager Autodarts local.",
4
4
  "host_port": "Port Autodarts (Boardmanager)",
5
5
  "host_port_help": "Numéro de port du Boardmanager Autodarts local.",
6
6
  "intro_txt": "Configuration de l'adaptateur Autodarts.",
7
- "polling": "Intervalle d'interrogation (ms)",
8
- "polling_help": "Intervalle d'interrogation en millisecondes pour récupérer les données d'Autodarts Boardmanager.",
9
- "reset": "Déclencheur-réinitialisation (ms)",
10
- "reset_help": "Réinitialisez le déclencheur triple et bullseye après x ms (0 = pas de réinitialisation).",
7
+ "polling": "Intervalle(s) d'interrogation",
8
+ "polling_help": "Intervalle d'interrogation en secondes pour récupérer les données de l'Autodarts Boardmanager.",
9
+ "reset": "Déclencheur-Réinitialisation(s)",
10
+ "reset_help": "Réinitialisez le déclencheur triple et bullseye après x secondes (0 = pas de réinitialisation).",
11
11
  "triple_flag": "Champ minimum pour le triple déclencheur",
12
12
  "triple_flag2": "Champ maximum pour le triple déclencheur",
13
13
  "triple_flag2_help": "Champ de score maximum pour le triple déclencheur. Les fléchettes avec un score supérieur à cette valeur ne déclencheront pas le point de données Triple-Trigger.",
@@ -4,10 +4,10 @@
4
4
  "host_port": "Porta Autodarts (Boardmanager).",
5
5
  "host_port_help": "Numero di porta del Boardmanager Autodarts locale.",
6
6
  "intro_txt": "Configurazione dell'adattatore Autodarts.",
7
- "polling": "Intervallo di polling (ms)",
8
- "polling_help": "Intervallo di polling in millisecondi per recuperare i dati da Autodarts Boardmanager.",
9
- "reset": "Ripristino trigger (ms)",
10
- "reset_help": "Ripristina il trigger triplo e bullseye dopo x ms (0 = nessun ripristino).",
7
+ "polling": "Intervallo di polling (s)",
8
+ "polling_help": "Intervallo di polling in secondi per recuperare i dati da Autodarts Boardmanager.",
9
+ "reset": "Trigger-Reset(s)",
10
+ "reset_help": "Ripristina il grilletto triplo e bullseye dopo x secondi (0 = nessun ripristino).",
11
11
  "triple_flag": "Campo minimo per il triplo trigger",
12
12
  "triple_flag2": "Campo massimo per il triplo trigger",
13
13
  "triple_flag2_help": "Campo del punteggio massimo per il triplo trigger. Le freccette con un punteggio superiore a questo valore non attiveranno il punto dati Triple-Trigger.",
@@ -4,10 +4,10 @@
4
4
  "host_port": "Autodarts (Bestuursmanager) Port",
5
5
  "host_port_help": "Poortnummer van de lokale Autodarts Boardmanager.",
6
6
  "intro_txt": "Autodarts-adapterconfiguratie.",
7
- "polling": "Polling-interval (ms)",
8
- "polling_help": "Polling-interval in milliseconden om gegevens uit de Autodarts Boardmanager op te halen.",
9
- "reset": "Trigger-reset (ms)",
10
- "reset_help": "Reset de drievoudige en bullseye-trigger na x ms (0 = geen reset).",
7
+ "polling": "Polling-interval (s)",
8
+ "polling_help": "Polling-interval in seconden om gegevens uit de Autodarts Boardmanager op te halen.",
9
+ "reset": "Trigger-reset (s)",
10
+ "reset_help": "Reset de drievoudige en bullseye-trigger na x seconden (0 = geen reset).",
11
11
  "triple_flag": "Minimumveld voor de drievoudige trigger",
12
12
  "triple_flag2": "Maximaal veld voor de drievoudige trigger",
13
13
  "triple_flag2_help": "Maximaal scoreveld voor de drievoudige trigger. Darten met een score boven deze waarde activeren het Triple-Trigger-datapunt niet.",
@@ -4,10 +4,10 @@
4
4
  "host_port": "Port Autodarts (Boardmanager).",
5
5
  "host_port_help": "Numer portu lokalnego zarządcy Autodarts.",
6
6
  "intro_txt": "Konfiguracja adaptera Autodarts.",
7
- "polling": "Interwał odpytywania (ms)",
8
- "polling_help": "Interwał odpytywania w milisekundach w celu pobrania danych z menedżera Autodarts Boardmanager.",
9
- "reset": "Reset wyzwalacza (ms)",
10
- "reset_help": "Zresetuj wyzwalacz potrójny i tarczy po x ms (0 = brak resetu).",
7
+ "polling": "Interwał odpytywania (s)",
8
+ "polling_help": "Interwał odpytywania w sekundach w celu pobrania danych z menedżera Autodarts Boardmanager.",
9
+ "reset": "Reset wyzwalacza (s)",
10
+ "reset_help": "Zresetuj wyzwalacz potrójny i tarczy po x sekundach (0 = brak resetu).",
11
11
  "triple_flag": "Minimalne pole dla potrójnego wyzwalacza",
12
12
  "triple_flag2": "Maksymalne pole dla potrójnego wyzwalacza",
13
13
  "triple_flag2_help": "Pole maksymalnego wyniku dla potrójnego wyzwalacza. Rzutki z wynikiem powyżej tej wartości nie uruchomią punktu danych Triple-Trigger.",
@@ -4,10 +4,10 @@
4
4
  "host_port": "Porto Autodarts (Boardmanager)",
5
5
  "host_port_help": "Número da porta do Autodarts Boardmanager local.",
6
6
  "intro_txt": "Configuração do adaptador Autodarts.",
7
- "polling": "Intervalo de pesquisa (ms)",
8
- "polling_help": "Intervalo de pesquisa em milissegundos para recuperar dados do Autodarts Boardmanager.",
9
- "reset": "Reinicialização do gatilho (ms)",
10
- "reset_help": "Redefina o gatilho triplo e alvo após x ms (0 = sem reinicialização).",
7
+ "polling": "Intervalo(s) de pesquisa",
8
+ "polling_help": "Intervalo de pesquisa em segundos para recuperar dados do Autodarts Boardmanager.",
9
+ "reset": "Redefinição(ões) de gatilho",
10
+ "reset_help": "Redefina o gatilho triplo e alvo após x segundos (0 = sem reinicialização).",
11
11
  "triple_flag": "Campo mínimo para o disparo triplo",
12
12
  "triple_flag2": "Campo máximo para o disparo triplo",
13
13
  "triple_flag2_help": "Campo de pontuação máxima para o disparo triplo. Dardos com pontuação acima deste valor não acionarão o ponto de dados Triple-Trigger.",
@@ -4,10 +4,10 @@
4
4
  "host_port": "Порт Autodarts (Boardmanager)",
5
5
  "host_port_help": "Номер порта местного Autodarts Boardmanager.",
6
6
  "intro_txt": "Конфигурация адаптера Autodarts.",
7
- "polling": "Интервал опроса (мс)",
8
- "polling_help": "Интервал опроса в миллисекундах для получения данных из Autodarts Boardmanager.",
9
- "reset": "Триггер-сброс (мс)",
10
- "reset_help": "Сбросьте триггер и триггер «яблочко» через x мс (0 = сброса нет).",
7
+ "polling": "Интервал опроса (с)",
8
+ "polling_help": "Интервал опроса в секундах для получения данных из Autodarts Boardmanager.",
9
+ "reset": "Триггер-Сброс (ы)",
10
+ "reset_help": "Сбросьте триггер и триггер «яблочко» через x секунд (0 = сброса нет).",
11
11
  "triple_flag": "Минимальное поле для тройного триггера",
12
12
  "triple_flag2": "Максимальное поле для тройного триггера",
13
13
  "triple_flag2_help": "Поле максимального результата для тройного триггера. Дартс с результатом выше этого значения не будет активировать точку данных тройного триггера.",
@@ -4,10 +4,10 @@
4
4
  "host_port": "Autodarts (Boardmanager) Порт",
5
5
  "host_port_help": "Номер порту місцевого менеджера Autodarts Board.",
6
6
  "intro_txt": "Конфігурація адаптера Autodarts.",
7
- "polling": "Інтервал опитування (мс)",
8
- "polling_help": "Інтервал опитування в мілісекундах для отримання даних із Autodarts Boardmanager.",
9
- "reset": "Скидання тригера (мс)",
10
- "reset_help": "Скинути потрійний тригер і тригер «яблучко» через x мс (0 = без скидання).",
7
+ "polling": "Інтервал опитування (с)",
8
+ "polling_help": "Інтервал опитування в секундах для отримання даних із Autodarts Boardmanager.",
9
+ "reset": "Тригер-Скидання (s)",
10
+ "reset_help": "Скинути потрійний тригер і тригер «яблочко» через x секунд (0 = без скидання).",
11
11
  "triple_flag": "Мінімальне поле для потрійного тригера",
12
12
  "triple_flag2": "Максимальне поле для потрійного тригера",
13
13
  "triple_flag2_help": "Поле максимального балу для потрійного тригера. Дартс із результатом вище цього значення не активує точку даних Triple-Trigger.",
@@ -4,10 +4,10 @@
4
4
  "host_port": "Autodarts(Boardmanager)端口",
5
5
  "host_port_help": "本地 Autodarts Boardmanager 的端口号。",
6
6
  "intro_txt": "Autodarts 适配器配置。",
7
- "polling": "轮询间隔(毫秒)",
8
- "polling_help": "从 Autodarts Boardmanager 检索数据的轮询间隔(以毫秒为单位)。",
9
- "reset": "触发-复位(毫秒)",
10
- "reset_help": "x 毫秒后重置三重触发器和牛眼触发器(0 = 不重置)。",
7
+ "polling": "轮询间隔(秒)",
8
+ "polling_help": "从 Autodarts Boardmanager 检索数据的轮询间隔(以秒为单位)。",
9
+ "reset": "触发-复位",
10
+ "reset_help": "x 秒后重置三重触发器和靶心触发器(0 = 不重置)。",
11
11
  "triple_flag": "三重触发器的最小字段",
12
12
  "triple_flag2": "三重触发器的最大字段",
13
13
  "triple_flag2_help": "三重触发器的最大分数字段。分数高于此值的飞镖将不会触发三重触发数据点。",
@@ -126,7 +126,7 @@
126
126
  "marginBottom": "10px"
127
127
  }
128
128
  },
129
- "triggerResetMs": {
129
+ "triggerResetSec": {
130
130
  "type": "number",
131
131
  "label": "reset",
132
132
  "help": "reset_help",
@@ -142,11 +142,11 @@
142
142
  "marginBottom": "10px"
143
143
  }
144
144
  },
145
- "interval": {
145
+ "intervalSec": {
146
146
  "type": "number",
147
147
  "label": "polling",
148
148
  "help": "polling_help",
149
- "default": 1000,
149
+ "default": 1,
150
150
  "newLine": true,
151
151
  "sm": 12,
152
152
  "xs": 12,
package/io-package.json CHANGED
@@ -1,8 +1,21 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "autodarts",
4
- "version": "0.3.2",
4
+ "version": "0.3.3",
5
5
  "news": {
6
+ "0.3.3": {
7
+ "en": "Changed: Configuration fields interval and triggerReset now use seconds instead of milliseconds in the admin UI.",
8
+ "de": "Geändert: Konfiguration Felder Intervall und TriggerReset verwenden jetzt Sekunden statt Millisekunden im Admin UI.",
9
+ "ru": "Изменение: интервалы полей конфигурации и триггер сброс теперь используют секунды вместо миллисекунд в пользовательском интерфейсе администратора.",
10
+ "pt": "Modificado: Intervalo de campos de configuração e gatilhoReset agora use segundos em vez de milissegundos na interface de administração.",
11
+ "nl": "Gewijzigd: Configuratievelden interval en triggerReset gebruikt nu seconden in plaats van milliseconden in de admin UI.",
12
+ "fr": "Changed: Champs de configuration intervalle et triggerReset maintenant utiliser secondes au lieu de millisecondes dans l'interface utilisateur admin.",
13
+ "it": "Modificato: intervallo di campi di configurazione e triggerReset ora utilizzare secondi invece di millisecondi nell'interfaccia utente di amministrazione.",
14
+ "es": "Cambio: intervalo de campos de configuración y gatilloReset ahora use segundos en lugar de milisegundos en la interfaz de administración.",
15
+ "pl": "Zmieniony: Przedział pól konfiguracyjnych i tryggerReset używają teraz sekund zamiast milisekund w interfejsu administratora.",
16
+ "uk": "Змінено: інтервал конфігураційних полів і тригерЗмінити зараз за допомогою секунд замість мілісекундів в адмін UI.",
17
+ "zh-cn": "已更改: 配置字段间隔和触发 Reset 现在在管理员UI中使用秒而不是毫秒 ."
18
+ },
6
19
  "0.3.2": {
7
20
  "en": "**ENHANCED**: Fixed all TypeScript type errors by adding proper type definitions for config properties\n**ENHANCED**: Refactored HTTP request handling - created reusable httpHelper module to eliminate code duplication\n**ENHANCED**: Converted HTTP callback-based requests to async/await pattern for better error handling\n**ENHANCED**: Improved connection state logging - now logs when connection is restored after being offline\n**ENHANCED**: Standardized async/await usage across all state change handlers for consistency\n**FIXED**: Removed unused error variable in fetchVersion method\n**FIXED**: Added proper error type checking in fetchConfig to prevent runtime errors\n**TESTING**: Added comprehensive unit tests for httpHelper module covering success, timeout, and error scenarios",
8
21
  "de": "**ENHANCED**: Alle TypeScript-Typfehler behoben, indem richtige Typendefinitionen für config-Eigenschaften hinzugefügt wurden\n**ENHANCED**: Refactored HTTP Request Handling - erstelltes wiederverwendbares httpHelper Modul zur Beseitigung der Codevervielfachung\n**ENHANCED**: Konvertierte HTTP-Requests auf async/await-Muster für eine bessere Fehlerbehandlung\n**ENHANCED**: Verbesserte Verbindungszustandsprotokollierung - protokolliert nun, wenn die Verbindung nach Offline wiederhergestellt wird\n**ENHANCED**: Standardisierte async/await Nutzung über alle State Change-Handler für Konsistenz\n**FIXED**: Ungenutzte Fehlervariable in fetchVersion Methode entfernt\n**FIXED**: Es wurde eine ordnungsgemäße Fehlersuche im fetchConfig hinzugefügt, um Laufzeitfehler zu verhindern\n**TESTING**: Ergänzende Unit-Tests für das httpHelper-Modul für Erfolgs-, Timeout- und Fehlerszenarien",
@@ -80,19 +93,6 @@
80
93
  "pl": "Dodano punkt danych dla byków\nDodano wynik flagi maximun triplehit\nAktualizuj konfigurację\nOstrzeżenie w dzienniku wyczyszczonym",
81
94
  "uk": "Додано точку даних для биків-хіт\nДодано максимальний потрійний-hit прапорець бал\nНалаштування оновлення\nПопередження в журналі",
82
95
  "zh-cn": "给 bull- hit 添加数据点\n增加最大值的三重旗分\n更新配置\n清除日志中的警告"
83
- },
84
- "0.1.0": {
85
- "en": "Added datapoints for visit score, current dart score, triple-hit flag with configurable minimum score, and camera configuration (cam0–cam2).\nCleaned up adapter logic and internal polling/timing.\nUpdated translations.",
86
- "de": "Weitere Datenpunkte für Besuchscore, aktuelle Dart-Score, Tripel-hit-Flag mit konfigurierbaren minimalen Punktzahl und Kamerakonfiguration (cam0–cam2).\nAufgereinigte Adapterlogik und interne Abfrage/timing.\nAktualisierte Übersetzungen.",
87
- "ru": "Добавлены точки данных для оценки посещений, текущая оценка дарта, флаг тройного удара с настраиваемым минимальным баллом и конфигурация камеры (cam0-cam2).\nОчищена адаптерная логика и внутренний опрос/настройка.\nОбновленные переводы.",
88
- "pt": "Adicionados pontos de dados para a pontuação de visita, pontuação de dardo atual, bandeira de triplo hit com pontuação mínima configurável, e configuração da câmera (cam0–cam2).\nLimpei a lógica do adaptador e as pesquisas internas.\nTradução atualizada.",
89
- "nl": "Toegevoegd datapoints voor bezoek score, huidige dart score, triple-hit vlag met configureerbare minimum score, en camera configuratie (cam0.\nOpgeruimd adapter logica en interne peiling / timing.\nBijgewerkte vertalingen.",
90
- "fr": "Ajout de points de données pour le score de visite, le score de fléchette actuel, le drapeau triple-hit avec le score minimum configurable et la configuration de la caméra (cam0–cam2).\nNettoyer la logique de l'adaptateur et effectuer des sondages internes/timing.\nTraductions actualisées.",
91
- "it": "Aggiunti i datapoint per il punteggio di visita, il punteggio di freccette corrente, la bandiera a triplo punto con il punteggio minimo configurabile e la configurazione della fotocamera (cam0–cam2).\nPulito logica adattatore e polling/timing interno.\nTraduzione aggiornata.",
92
- "es": "Puntos de datos añadidos para la puntuación de la visita, puntaje del dardo actual, bandera triple con puntaje mínimo configurable, y configuración de la cámara (cam0–cam2).\nLógica del adaptador limpiado y polinización interna / estimulación.\nTraducciones actualizadas.",
93
- "pl": "Dodano punkty datapointowe dla wyniku odwiedzin, aktualny wynik dart, flagę trójuderzeniową z konfigurowalnym minimalnym wynikiem oraz konfigurację kamery (cam0- cam2).\nOczyszczona logika adaptera i wewnętrzny sondaż / czas.\nAktualizacja tłumaczeń.",
94
- "uk": "Додано точки даних для облікового запису, поточний запис dart, потрійний прапор з налаштуванням мінімального балу та конфігурації камери (cam0–cam2).\nЗнімання логіки адаптера та внутрішнього опитування / термінів.\nОновлені переклади.",
95
- "zh-cn": "添加了访问分数的数据点,当前飞镖分数,三重击旗可配置最小分数,以及相机配置(cam0–cam2).\n清理适配器逻辑和内部投票/计时.\n最新译名."
96
96
  }
97
97
  },
98
98
  "titleLang": {
@@ -164,7 +164,10 @@
164
164
  "native": {
165
165
  "host": "127.0.0.1",
166
166
  "port": 3180,
167
- "interval": 1000
167
+ "intervalSec": 1,
168
+ "triggerResetSec": 0,
169
+ "tripleMinScore": 1,
170
+ "tripleMaxScore": 20
168
171
  },
169
172
  "objects": [],
170
173
  "instanceObjects": []
package/lib/throw.js CHANGED
@@ -133,8 +133,8 @@ async function updateThrow(adapter, lastDart) {
133
133
  await adapter.setStateAsync("throw.isTriple", { val: isTriple, ack: true });
134
134
  await adapter.setStateAsync("throw.isBullseye", { val: isBullseye, ack: true });
135
135
 
136
- // @ts-expect-error - triggerResetMsRuntime is a custom property in the Autodarts adapter class
137
- const timeoutMs = Number(adapter.triggerResetMsRuntime) || 0;
136
+ // @ts-expect-error - triggerResetSecRuntime is a custom property in the Autodarts adapter class
137
+ const timeoutMs = (Number(adapter.triggerResetSecRuntime) || 0) * 1000;
138
138
  if (timeoutMs > 0) {
139
139
  if (isTriple) {
140
140
  // @ts-expect-error - tripleResetTimer is a custom property in the Autodarts adapter class
@@ -1,3 +1,4 @@
1
+ // lib/trafficLight.js
1
2
  "use strict";
2
3
 
3
4
  /**
package/main.js CHANGED
@@ -27,7 +27,7 @@ class Autodarts extends utils.Adapter {
27
27
  this.tripleMaxScoreRuntime = null; // Laufzeitwert für Triple-Maxschwelle
28
28
 
29
29
  // NEU: Reset-Timeout + Timer für isTriple/isBullseye
30
- this.triggerResetMsRuntime = null;
30
+ this.triggerResetSecRuntime = null;
31
31
  this.tripleResetTimer = null;
32
32
  this.bullResetTimer = null;
33
33
  }
@@ -38,10 +38,10 @@ class Autodarts extends utils.Adapter {
38
38
  // Defaults aus io-package.json absichern
39
39
  this.config.host ??= "127.0.0.1";
40
40
  this.config.port ??= 3180;
41
- this.config.interval ??= 1000;
42
- this.config.tripleMinScore ??= 1; // Mindestpunktzahl für Triple-Flag
43
- this.config.tripleMaxScore ??= 20; // Maximalpunktzahl für Triple-Flag
44
- this.config.triggerResetMs ??= 0; // 0 = kein Auto-Reset
41
+ this.config.intervalSec ??= 1; // Sekunden
42
+ this.config.tripleMinScore ??= 1;
43
+ this.config.tripleMaxScore ??= 20;
44
+ this.config.triggerResetSec ??= 0; // 0 = kein Auto-Reset
45
45
 
46
46
  // Visit-Struktur anlegen (ausgelagert)
47
47
  await visit.init(this);
@@ -158,7 +158,7 @@ class Autodarts extends utils.Adapter {
158
158
  native: {},
159
159
  });
160
160
 
161
- // Config-Channel und States für tripleMinScore / tripleMaxScore / triggerResetMs (zur Laufzeit änderbar)
161
+ // Config-Channel und States für tripleMinScore / tripleMaxScore / triggerResetSec (zur Laufzeit änderbar)
162
162
  await this.extendObjectAsync("config", {
163
163
  type: "channel",
164
164
  common: {
@@ -208,20 +208,20 @@ class Autodarts extends utils.Adapter {
208
208
  native: {},
209
209
  });
210
210
 
211
- await this.extendObjectAsync("config.triggerResetMs", {
211
+ await this.extendObjectAsync("config.triggerResetSec", {
212
212
  type: "state",
213
213
  common: {
214
214
  name: {
215
- en: "Triple/Bull reset (ms)",
216
- de: "Triple/Bull Reset (ms)",
215
+ en: "Triple/Bull reset (s)",
216
+ de: "Triple/Bull Reset (s)",
217
217
  },
218
218
  type: "number",
219
219
  role: "value",
220
220
  read: true,
221
221
  write: true,
222
222
  desc: {
223
- en: "Time in ms after which isTriple and isBullseye are reset to false",
224
- de: "Zeit in ms, nach der isTriple und isBullseye wieder auf false gesetzt werden",
223
+ en: "Time in seconds after which isTriple and isBullseye are reset to false",
224
+ de: "Zeit in Sekunden, nach der isTriple und isBullseye wieder auf false gesetzt werden",
225
225
  },
226
226
  },
227
227
  native: {},
@@ -230,7 +230,7 @@ class Autodarts extends utils.Adapter {
230
230
  // Laufzeitwerte initial aus Adapter-Config setzen
231
231
  this.tripleMinScoreRuntime = Number(this.config.tripleMinScore) || 1;
232
232
  this.tripleMaxScoreRuntime = Number(this.config.tripleMaxScore) || 20;
233
- this.triggerResetMsRuntime = Number(this.config.triggerResetMs) || 0; // 0 = kein Auto-Reset
233
+ this.triggerResetSecRuntime = Number(this.config.triggerResetSec) || 0; // 0 = kein Auto-Reset
234
234
 
235
235
  await this.setStateAsync("config.tripleMinScore", {
236
236
  val: this.tripleMinScoreRuntime,
@@ -241,8 +241,8 @@ class Autodarts extends utils.Adapter {
241
241
  ack: true,
242
242
  });
243
243
 
244
- await this.setStateAsync("config.triggerResetMs", {
245
- val: this.triggerResetMsRuntime,
244
+ await this.setStateAsync("config.triggerResetSec", {
245
+ val: this.triggerResetSecRuntime,
246
246
  ack: true,
247
247
  });
248
248
 
@@ -252,14 +252,17 @@ class Autodarts extends utils.Adapter {
252
252
  // Auf Änderungen am Config-State hören
253
253
  this.subscribeStates("config.tripleMinScore");
254
254
  this.subscribeStates("config.tripleMaxScore");
255
- this.subscribeStates("config.triggerResetMs");
255
+ this.subscribeStates("config.triggerResetSec");
256
256
 
257
257
  // Zustand zurücksetzen
258
258
  this.lastThrowsCount = 0;
259
259
  this.lastSignature = "";
260
260
 
261
+ // Polling-Intervall aus Sekunden in Millisekunden umrechnen
262
+ const pollIntervalMs = (Number(this.config.intervalSec) || 1) * 1000;
263
+
261
264
  // Polling starten
262
- this.pollTimer = setInterval(() => this.fetchState(), this.config.interval);
265
+ this.pollTimer = setInterval(() => this.fetchState(), pollIntervalMs);
263
266
  this.fetchState();
264
267
 
265
268
  // Boardmanager-Version und Kameras abfragen und alle 5 Minuten aktualisieren
@@ -288,7 +291,7 @@ class Autodarts extends utils.Adapter {
288
291
  }
289
292
 
290
293
  /**
291
- * Reaktion auf State-Änderungen (z. B. config.tripleMinScore / config.tripleMaxScore / config.triggerResetMs)
294
+ * Reaktion auf State-Änderungen (z. B. config.tripleMinScore / config.tripleMaxScore / config.triggerResetSec)
292
295
  *
293
296
  * @param {string} id Full state id
294
297
  * @param {ioBroker.State | null | undefined} state New state value (ack=false on user write)
@@ -329,18 +332,18 @@ class Autodarts extends utils.Adapter {
329
332
 
330
333
  // Wert mit ack bestätigen
331
334
  await this.setStateAsync("config.tripleMaxScore", { val, ack: true });
332
- } else if (idShort === "config.triggerResetMs") {
335
+ } else if (idShort === "config.triggerResetSec") {
333
336
  const val = Number(state.val);
334
337
  if (!Number.isFinite(val) || val < 0) {
335
- this.log.warn(`Invalid triggerResetMs value: ${state.val}`);
338
+ this.log.warn(`Invalid triggerResetSec value: ${state.val}`);
336
339
  return;
337
340
  }
338
341
 
339
- this.triggerResetMsRuntime = val;
340
- this.log.info(`Runtime triggerResetMs updated to ${val} ms`);
342
+ this.triggerResetSecRuntime = val;
343
+ this.log.info(`Runtime triggerResetSec updated to ${val} s`);
341
344
 
342
345
  // Wert mit ack bestätigen
343
- await this.setStateAsync("config.triggerResetMs", { val, ack: true });
346
+ await this.setStateAsync("config.triggerResetSec", { val, ack: true });
344
347
  }
345
348
  }
346
349
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.autodarts",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Autodarts Autoscoring",
5
5
  "author": "skvarel <skvarel@inventwo.com>",
6
6
  "contributors": [