iobroker.autodarts 0.6.2 → 0.7.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/README.md CHANGED
@@ -31,6 +31,7 @@ Connects to your local Autodarts Board Manager (via IP and port, e.g. `192.168.x
31
31
  - **`throw.isMiss`**: Boolean flag that is true when the dart does not hit any valid scoring segment (pure miss, no score)
32
32
 
33
33
  ### Board Status
34
+ - **`status.boardStatus`**: Status indicator of board event (e.g. `"Stopped"`, `"Calibration finished"`, `"Started"`).
34
35
  - **`status.trafficLightColor`**: HEX color of current board status
35
36
  - **`status.trafficLightState`**: Status indicator
36
37
  - `green` = Player may throw
@@ -116,6 +117,14 @@ In **HELP & FAQ** you will find general information and help about the adapter a
116
117
  <!--
117
118
  ### **WORK IN PROGRESS**
118
119
  -->
120
+ ### 0.7.0 (2025-12-31)
121
+ - Added: New `status.boardStatus` state. Status indicator of board event (e.g. `"Stopped"`, `"Calibration finished"`, `"Started"`).
122
+
123
+ ### 0.6.3 (2025-12-30)
124
+ - (skvarel) Improved: Connection handling now uses `info.connection` and clearly marks the adapter as offline when the Autodarts Board Manager is not reachable (including better timeout/ECONNRESET handling).
125
+ - (skvarel) Changed: Reduced log noise when the board is offline – only one warning is logged when the connection is lost, subsequent timeouts are written as debug messages.
126
+ - (skvarel) Improved: Minor tweaks to the HELP & FAQ tab texts and configuration descriptions.
127
+
119
128
  ### 0.6.2 (2025-12-29)
120
129
  - (skvarel) Improved: Settings page reworked to use three tabs (`OPTIONS`, `MAPPINGS` and `HELP & FAQ`) for better clarity.
121
130
 
@@ -5,19 +5,22 @@
5
5
  "host_port": "Autodarts (Boardmanager) Port",
6
6
  "host_port_help": "Portnummer des lokalen Autodarts Boardmanagers.",
7
7
  "intro_txt": "Hilfe & FAQ",
8
- "light_target": "LED-Ring Datenpunkt",
8
+ "light_target": "LED-Ring-POWER Datenpunkt",
9
+ "light_target_brightness": "LED-Ring-Dimmer Datenpunkt",
10
+ "light_target_color": "LED-Ring-Farb Datenpunkt",
9
11
  "light_target_help": "Datenpunkt des LED-Ring zur Steuerung innerhalb des Autodarts-Adapters. Lasse das Feld leer, um die Lichtsteuerung zu deaktivieren.",
10
- "light_txt": "Zuweisungen der Lichtsteuerung",
12
+ "light_txt": "Zuweisungen der Lichtsteuerung (optional)",
11
13
  "light_txt_desc": "Verknüpfe deine Beleuchtung-Datenpunkte in die Autodarts-Objekte.",
12
14
  "mappings": "Zuweisungen",
13
15
  "options": "Optionen",
14
16
  "options_connection": "Verbindungsoptionen",
15
17
  "options_logic": "Logikoptionen",
18
+ "paypal_donate": "Falls du uns unterstützen möchtest.",
16
19
  "polling": "Abfrageintervall (s)",
17
20
  "polling_help": "Abfrageintervall in Sekunden zum Abrufen von Daten vom Autodarts Boardmanager.",
18
21
  "power_target": "Power-Datenpunkt",
19
22
  "power_target_help": "Datenpunkt der Server- oder Bildschirm-Steckdose zur Steuerung innerhalb des Autodarts-Adapters. Lasse das Feld leer, um die Leistungssteuerung zu deaktivieren.",
20
- "power_txt": "Zuweisungen der Leistungssteuerung",
23
+ "power_txt": "Zuweisungen der Leistungssteuerung (optional)",
21
24
  "power_txt_desc": "Verknüpfe deine Power-Datenpunkte in die Autodarts-Objekte.",
22
25
  "reset": "Trigger-Reset (s)",
23
26
  "reset_help": "Setzt den Triple-, Doppel-, Bullseye und Miss-Trigger nach x Sekunden zurück (0 = kein Reset).",
@@ -13,18 +13,21 @@
13
13
  "reset": "Trigger-Reset (s)",
14
14
  "reset_help": "Reset the triple, double, bullseye and miss trigger after x seconds (0 = no reset).",
15
15
  "light_target": "Light Target ID",
16
- "light_target_help": "ID of the light target to control lights via Autodarts (e.g., 'light.living_room'). Leave empty to disable light control.",
17
- "power_target": "Power Target ID",
16
+ "light_target_help": "ID of the light target to control lights via Autodarts (e.g., 'light.dartring'). Leave empty to disable light control.",
17
+ "power_target": "LED-Target Power ID",
18
18
  "power_target_help": "ID of the power target to control power via Autodarts (e.g., 'switch.darts_socket'). Leave empty to disable power control.",
19
19
  "options": "Options",
20
20
  "mappings":"Mappings",
21
21
  "options_connection": "Connection Options",
22
22
  "options_logic": "Logic Options",
23
23
  "txt_one": "This adapter connects your local Autodarts Board Manager to ioBroker.\n\n1) Configure the connection under OPTIONS (host, port, polling, triple range).\n2) Map light and power targets under MAPPINGS.\n3) Use the created states (throws, traffic light, hardware) in your visualizations, scripts and scenes.",
24
- "light_txt": "Light Control Mapping",
24
+ "light_txt": "Light Control Mapping (optional)",
25
25
  "light_txt_desc": "Get your lighting data points into the adapter objects.",
26
- "power_txt": "Power Control Mapping",
26
+ "power_txt": "Power Control Mapping (optional)",
27
27
  "power_txt_desc": "Get your power data points into the adapter objects.",
28
28
  "helps": "Help & FAQ",
29
- "txt_two": "... more information coming soon!"
29
+ "txt_two": "... more information coming soon!",
30
+ "light_target_brightness": "LED-Target Brightness ID",
31
+ "light_target_color": "LED-Target Color ID",
32
+ "paypal_donate": "Donate with PayPal"
30
33
  }
@@ -6,18 +6,21 @@
6
6
  "host_port_help": "Número de puerto del administrador local de Autodarts Boardmanager.",
7
7
  "intro_txt": "Ayuda y preguntas frecuentes.",
8
8
  "light_target": "ID de objetivo ligero",
9
- "light_target_help": "ID del objetivo de luz para controlar las luces a través de Autodarts (por ejemplo, 'light.living_room'). Déjelo vacío para desactivar el control de luces.",
10
- "light_txt": "Mapeo de control de iluminación",
9
+ "light_target_brightness": "ID de brillo del objetivo LED",
10
+ "light_target_color": "ID de color de objetivo LED",
11
+ "light_target_help": "ID del objetivo de luz para controlar las luces a través de Autodarts (por ejemplo, 'light.dartring'). Déjelo vacío para desactivar el control de luces.",
12
+ "light_txt": "Mapeo de control de iluminación (opcional)",
11
13
  "light_txt_desc": "Introduzca sus puntos de datos de iluminación en los objetos del adaptador.",
12
14
  "mappings": "Mapeos",
13
15
  "options": "Opciones",
14
16
  "options_connection": "Opciones de conexión",
15
17
  "options_logic": "Opciones lógicas",
18
+ "paypal_donate": "Donar con PayPal",
16
19
  "polling": "Intervalo(s) de sondeo",
17
20
  "polling_help": "Intervalo de sondeo en segundos para recuperar datos del Autodarts Boardmanager.",
18
- "power_target": "ID de objetivo de potencia",
21
+ "power_target": "ID de alimentación del objetivo LED",
19
22
  "power_target_help": "ID del objetivo de energía para controlar la energía a través de Autodarts (por ejemplo, 'switch.darts_socket'). Déjelo vacío para desactivar el control de energía.",
20
- "power_txt": "Mapeo de control de energía",
23
+ "power_txt": "Mapeo de control de energía (opcional)",
21
24
  "power_txt_desc": "Introduzca sus puntos de datos de energía en los objetos del adaptador.",
22
25
  "reset": "Restablecimiento de disparador (s)",
23
26
  "reset_help": "Restablezca el disparador triple, doble, diana y fallido después de x segundos (0 = sin reinicio).",
@@ -6,18 +6,21 @@
6
6
  "host_port_help": "Numéro de port du Boardmanager Autodarts local.",
7
7
  "intro_txt": "Aide et FAQ.",
8
8
  "light_target": "ID de cible lumineuse",
9
- "light_target_help": "ID de la cible lumineuse pour contrôler les lumières via Autodarts (par exemple, « light.living_room »). Laissez vide pour désactiver le contrôle de la lumière.",
10
- "light_txt": "Cartographie du contrôle de la lumière",
9
+ "light_target_brightness": "ID de luminosité cible LED",
10
+ "light_target_color": "ID de couleur cible LED",
11
+ "light_target_help": "ID de la cible lumineuse pour contrôler les lumières via Autodarts (par exemple, « light.dartring »). Laissez vide pour désactiver le contrôle de la lumière.",
12
+ "light_txt": "Cartographie du contrôle de la lumière (facultatif)",
11
13
  "light_txt_desc": "Obtenez vos points de données d'éclairage dans les objets adaptateur.",
12
14
  "mappings": "Mappages",
13
15
  "options": "Possibilités",
14
16
  "options_connection": "Options de connexion",
15
17
  "options_logic": "Options logiques",
18
+ "paypal_donate": "Faites un don avec PayPal",
16
19
  "polling": "Intervalle(s) d'interrogation",
17
20
  "polling_help": "Intervalle d'interrogation en secondes pour récupérer les données de l'Autodarts Boardmanager.",
18
- "power_target": "ID de cible de puissance",
21
+ "power_target": "ID de puissance cible LED",
19
22
  "power_target_help": "ID de la cible d'alimentation pour contrôler l'alimentation via Autodarts (par exemple, « switch.darts_socket »). Laissez vide pour désactiver le contrôle de l’alimentation.",
20
- "power_txt": "Cartographie du contrôle de puissance",
23
+ "power_txt": "Cartographie du contrôle de puissance (facultatif)",
21
24
  "power_txt_desc": "Obtenez vos points de données d'alimentation dans les objets adaptateur.",
22
25
  "reset": "Déclencheur-Réinitialisation(s)",
23
26
  "reset_help": "Réinitialisez les déclencheurs triple, double, bullseye et miss après x secondes (0 = pas de réinitialisation).",
@@ -6,18 +6,21 @@
6
6
  "host_port_help": "Numero di porta del Boardmanager Autodarts locale.",
7
7
  "intro_txt": "Aiuto e domande frequenti.",
8
8
  "light_target": "ID del bersaglio luminoso",
9
- "light_target_help": "ID del target luminoso per controllare le luci tramite Autodarts (ad esempio, \"light.living_room\"). Lasciare vuoto per disabilitare il controllo della luce.",
10
- "light_txt": "Mappatura del controllo della luce",
9
+ "light_target_brightness": "ID luminosità target LED",
10
+ "light_target_color": "ID colore target LED",
11
+ "light_target_help": "ID del bersaglio luminoso per controllare le luci tramite Autodarts (ad esempio, \"light.dartring\"). Lasciare vuoto per disabilitare il controllo della luce.",
12
+ "light_txt": "Mappatura del controllo della luce (opzionale)",
11
13
  "light_txt_desc": "Inserisci i tuoi punti dati di illuminazione negli oggetti adattatore.",
12
14
  "mappings": "Mappature",
13
15
  "options": "Opzioni",
14
16
  "options_connection": "Opzioni di connessione",
15
17
  "options_logic": "Opzioni logiche",
18
+ "paypal_donate": "Dona con PayPal",
16
19
  "polling": "Intervallo di polling (s)",
17
20
  "polling_help": "Intervallo di polling in secondi per recuperare i dati da Autodarts Boardmanager.",
18
- "power_target": "ID del target di potenza",
21
+ "power_target": "ID alimentazione target LED",
19
22
  "power_target_help": "ID del target di potenza per controllare l'energia tramite Autodarts (ad esempio, \"switch.darts_socket\"). Lasciare vuoto per disabilitare il controllo dell'alimentazione.",
20
- "power_txt": "Mappatura del controllo della potenza",
23
+ "power_txt": "Mappatura del controllo della potenza (opzionale)",
21
24
  "power_txt_desc": "Inserisci i tuoi punti dati di alimentazione negli oggetti adattatore.",
22
25
  "reset": "Trigger-Reset(s)",
23
26
  "reset_help": "Resetta il trigger triplo, doppio, bullseye e mancato dopo x secondi (0 = nessun reset).",
@@ -6,18 +6,21 @@
6
6
  "host_port_help": "Poortnummer van de lokale Autodarts Boardmanager.",
7
7
  "intro_txt": "Hulp en veelgestelde vragen.",
8
8
  "light_target": "Lichtdoel-ID",
9
- "light_target_help": "ID van het lichtdoel om lampen te bedienen via Autodarts (bijvoorbeeld 'light.living_room'). Laat dit leeg om de lichtregeling uit te schakelen.",
10
- "light_txt": "Lichtregeling in kaart brengen",
9
+ "light_target_brightness": "LED-doelhelderheid ID",
10
+ "light_target_color": "LED-doelkleur-ID",
11
+ "light_target_help": "ID van het lichtdoel om lichten via Autodarts te besturen (bijvoorbeeld 'light.dartring'). Laat dit leeg om de lichtregeling uit te schakelen.",
12
+ "light_txt": "Lichtregelingtoewijzing (optioneel)",
11
13
  "light_txt_desc": "Haal uw verlichtingsgegevenspunten op in de adapterobjecten.",
12
14
  "mappings": "Toewijzingen",
13
15
  "options": "Opties",
14
16
  "options_connection": "Verbindingsopties",
15
17
  "options_logic": "Logische opties",
18
+ "paypal_donate": "Doneer met PayPal",
16
19
  "polling": "Polling-interval (s)",
17
20
  "polling_help": "Polling-interval in seconden om gegevens uit de Autodarts Boardmanager op te halen.",
18
- "power_target": "Power Target-ID",
21
+ "power_target": "LED-doelvoedings-ID",
19
22
  "power_target_help": "ID van het powertarget om de power te regelen via Autodarts (bijvoorbeeld 'switch.darts_socket'). Laat dit leeg om de stroomregeling uit te schakelen.",
20
- "power_txt": "In kaart brengen van energiebeheer",
23
+ "power_txt": "Power Control Mapping (optioneel)",
21
24
  "power_txt_desc": "Haal uw stroomgegevenspunten op in de adapterobjecten.",
22
25
  "reset": "Trigger-reset (s)",
23
26
  "reset_help": "Reset de drievoudige, dubbele, bullseye- en miss-trigger na x seconden (0 = geen reset).",
@@ -6,18 +6,21 @@
6
6
  "host_port_help": "Numer portu lokalnego zarządcy Autodarts.",
7
7
  "intro_txt": "Pomoc i często zadawane pytania.",
8
8
  "light_target": "Identyfikator lekkiego celu",
9
- "light_target_help": "Identyfikator celu świetlnego do sterowania światłami za pomocą Autodarts (np. „light.living_room”). Pozostaw puste, aby wyłączyć kontrolę oświetlenia.",
10
- "light_txt": "Mapowanie kontroli światła",
9
+ "light_target_brightness": "Identyfikator docelowej jasności LED",
10
+ "light_target_color": "Identyfikator koloru docelowego LED",
11
+ "light_target_help": "Identyfikator celu świetlnego do sterowania światłami za pomocą Autodarts (np. „light.dartring”). Pozostaw puste, aby wyłączyć kontrolę oświetlenia.",
12
+ "light_txt": "Mapowanie kontroli oświetlenia (opcjonalnie)",
11
13
  "light_txt_desc": "Umieść punkty danych oświetlenia w obiektach adaptera.",
12
14
  "mappings": "Mapowania",
13
15
  "options": "Opcje",
14
16
  "options_connection": "Opcje połączenia",
15
17
  "options_logic": "Opcje logiczne",
18
+ "paypal_donate": "Przekaż darowiznę za pomocą PayPal",
16
19
  "polling": "Interwał odpytywania (s)",
17
20
  "polling_help": "Interwał odpytywania w sekundach w celu pobrania danych z menedżera Autodarts Boardmanager.",
18
- "power_target": "Identyfikator celu mocy",
21
+ "power_target": "Identyfikator mocy docelowej LED",
19
22
  "power_target_help": "Identyfikator celu mocy do kontrolowania mocy za pomocą Autodarts (np. „switch.darts_socket”). Pozostaw puste, aby wyłączyć kontrolę mocy.",
20
- "power_txt": "Mapowanie kontroli mocy",
23
+ "power_txt": "Mapowanie sterowania mocą (opcjonalnie)",
21
24
  "power_txt_desc": "Umieść punkty danych mocy w obiektach adaptera.",
22
25
  "reset": "Reset wyzwalacza (s)",
23
26
  "reset_help": "Zresetuj wyzwalacz potrójny, podwójny, strzał w dziesiątkę i spudłowanie po x sekundach (0 = brak resetu).",
@@ -6,18 +6,21 @@
6
6
  "host_port_help": "Número da porta do Autodarts Boardmanager local.",
7
7
  "intro_txt": "Ajuda e perguntas frequentes.",
8
8
  "light_target": "ID do alvo claro",
9
- "light_target_help": "ID do alvo de luz para controlar luzes via Autodarts (por exemplo, 'light.living_room'). Deixe em branco para desativar o controle de luz.",
10
- "light_txt": "Mapeamento de controle de luz",
9
+ "light_target_brightness": "ID de brilho do alvo do LED",
10
+ "light_target_color": "ID da cor do alvo do LED",
11
+ "light_target_help": "ID do alvo de luz para controlar luzes via Autodarts (por exemplo, 'light.dartring'). Deixe em branco para desativar o controle de luz.",
12
+ "light_txt": "Mapeamento de controle de luz (opcional)",
11
13
  "light_txt_desc": "Coloque seus pontos de dados de iluminação nos objetos do adaptador.",
12
14
  "mappings": "Mapeamentos",
13
15
  "options": "Opções",
14
16
  "options_connection": "Opções de conexão",
15
17
  "options_logic": "Opções lógicas",
18
+ "paypal_donate": "Doe com PayPal",
16
19
  "polling": "Intervalo(s) de pesquisa",
17
20
  "polling_help": "Intervalo de pesquisa em segundos para recuperar dados do Autodarts Boardmanager.",
18
- "power_target": "ID do alvo avançado",
21
+ "power_target": "ID de energia do alvo LED",
19
22
  "power_target_help": "ID do alvo de potência para controlar a potência por meio de Autodarts (por exemplo, 'switch.darts_socket'). Deixe em branco para desativar o controle de energia.",
20
- "power_txt": "Mapeamento de controle de energia",
23
+ "power_txt": "Mapeamento de controle de energia (opcional)",
21
24
  "power_txt_desc": "Coloque seus pontos de dados de energia nos objetos do adaptador.",
22
25
  "reset": "Redefinição(ões) de gatilho",
23
26
  "reset_help": "Redefina o disparo triplo, duplo, alvo e erro após x segundos (0 = sem reinicialização).",
@@ -6,18 +6,21 @@
6
6
  "host_port_help": "Номер порта местного Autodarts Boardmanager.",
7
7
  "intro_txt": "Помощь и часто задаваемые вопросы.",
8
8
  "light_target": "Идентификатор легкой цели",
9
- "light_target_help": "Идентификатор световой цели для управления освещением через Autodarts (например, «light.living_room»). Оставьте пустым, чтобы отключить управление освещением.",
10
- "light_txt": "Сопоставление управления освещением",
9
+ "light_target_brightness": "Идентификатор яркости светодиодной цели",
10
+ "light_target_color": "Идентификатор цвета светодиодной мишени",
11
+ "light_target_help": "Идентификатор световой цели для управления огнями через Autodarts (например, «light.dartring»). Оставьте пустым, чтобы отключить управление освещением.",
12
+ "light_txt": "Отображение управления освещением (опционально)",
11
13
  "light_txt_desc": "Перенесите точки данных освещения в объекты адаптера.",
12
14
  "mappings": "Сопоставления",
13
15
  "options": "Параметры",
14
16
  "options_connection": "Варианты подключения",
15
17
  "options_logic": "Логические параметры",
18
+ "paypal_donate": "Пожертвовать через PayPal",
16
19
  "polling": "Интервал опроса (с)",
17
20
  "polling_help": "Интервал опроса в секундах для получения данных из Autodarts Boardmanager.",
18
- "power_target": "Идентификатор цели по мощности",
21
+ "power_target": "Идентификатор мощности светодиодной мишени",
19
22
  "power_target_help": "Идентификатор цели мощности для управления мощностью через Autodarts (например, «switch.darts_socket»). Оставьте пустым, чтобы отключить управление питанием.",
20
- "power_txt": "Сопоставление управления питанием",
23
+ "power_txt": "Сопоставление управления питанием (дополнительно)",
21
24
  "power_txt_desc": "Перенесите точки данных о мощности в объекты адаптера.",
22
25
  "reset": "Триггер-Сброс (ы)",
23
26
  "reset_help": "Сбросьте триггер тройного, двойного, яблочко и промаха через x секунд (0 = сброса нет).",
@@ -6,18 +6,21 @@
6
6
  "host_port_help": "Номер порту місцевого менеджера Autodarts Board.",
7
7
  "intro_txt": "Довідка та поширені запитання.",
8
8
  "light_target": "Ідентифікатор легкої цілі",
9
- "light_target_help": "Ідентифікатор цільового освітлення для керування освітленням через Autodarts (наприклад, \"light.living_room\"). Залиште пустим, щоб вимкнути керування світлом.",
10
- "light_txt": "Відображення керування світлом",
9
+ "light_target_brightness": "LED-Target Brightness ID",
10
+ "light_target_color": "LED-Target Color ID",
11
+ "light_target_help": "Ідентифікатор світлової цілі для керування вогнями через Autodarts (наприклад, \"light.dartring\"). Залиште пустим, щоб вимкнути керування світлом.",
12
+ "light_txt": "Відображення керування світлом (опціонально)",
11
13
  "light_txt_desc": "Перемістіть свої точки даних освітлення в об’єкти адаптера.",
12
14
  "mappings": "Відображення",
13
15
  "options": "Опції",
14
16
  "options_connection": "Параметри підключення",
15
17
  "options_logic": "Параметри логіки",
18
+ "paypal_donate": "Пожертвуйте за допомогою PayPal",
16
19
  "polling": "Інтервал опитування (с)",
17
20
  "polling_help": "Інтервал опитування в секундах для отримання даних із Autodarts Boardmanager.",
18
- "power_target": "Power Target ID",
21
+ "power_target": "LED-Target Power ID",
19
22
  "power_target_help": "Ідентифікатор цільової потужності для керування живленням через Autodarts (наприклад, 'switch.darts_socket'). Залиште пустим, щоб вимкнути керування живленням.",
20
- "power_txt": "Відображення контролю живлення",
23
+ "power_txt": "Відображення керування живленням (опціонально)",
21
24
  "power_txt_desc": "Перемістіть свої точки даних про потужність в об’єкти адаптера.",
22
25
  "reset": "Тригер-Скидання (s)",
23
26
  "reset_help": "Скинути потрійний, подвійний, яблучний і промах через x секунд (0 = без скидання).",
@@ -6,18 +6,21 @@
6
6
  "host_port_help": "本地 Autodarts Boardmanager 的端口号。",
7
7
  "intro_txt": "帮助和常见问题解答。",
8
8
  "light_target": "光目标ID",
9
- "light_target_help": "通过 Autodarts 控制灯光的灯光目标的 ID(例如“light.living_room”)。留空以禁用灯光控制。",
10
- "light_txt": "光控映射",
9
+ "light_target_brightness": "LED-目标亮度 ID",
10
+ "light_target_color": "LED 目标颜色 ID",
11
+ "light_target_help": "通过 Autodarts 控制灯光的灯光目标的 ID(例如“light.dartring”)。留空以禁用灯光控制。",
12
+ "light_txt": "灯光控制映射(可选)",
11
13
  "light_txt_desc": "将照明数据点放入适配器对象中。",
12
14
  "mappings": "映射",
13
15
  "options": "选项",
14
16
  "options_connection": "连接选项",
15
17
  "options_logic": "逻辑选项",
18
+ "paypal_donate": "通过 PayPal 捐赠",
16
19
  "polling": "轮询间隔(秒)",
17
20
  "polling_help": "从 Autodarts Boardmanager 检索数据的轮询间隔(以秒为单位)。",
18
- "power_target": "功率目标 ID",
21
+ "power_target": "LED-目标功率 ID",
19
22
  "power_target_help": "通过 Autodarts 控制电源的电源目标的 ID(例如“switch.darts_socket”)。留空以禁用电源控制。",
20
- "power_txt": "功率控制映射",
23
+ "power_txt": "功率控制映射(可选)",
21
24
  "power_txt_desc": "将电源数据点放入适配器对象中。",
22
25
  "reset": "触发-复位",
23
26
  "reset_help": "x 秒后重置三重、双重、靶心和错过触发(0 = 不重置)。",
@@ -275,6 +275,10 @@
275
275
  "help": "polling_help",
276
276
  "default": 1,
277
277
  "options": [
278
+ {
279
+ "label": "0.25 s",
280
+ "value": 0.25
281
+ },
278
282
  {
279
283
  "label": "0.5 s",
280
284
  "value": 0.5
@@ -451,34 +455,53 @@
451
455
  "fontSize": "12px"
452
456
  }
453
457
  },
458
+ "logo": {
459
+ "type": "staticImage",
460
+ "src": "inventwo.svg",
461
+ "newLine": true,
462
+ "sm": 0.5,
463
+ "xs": 0.5,
464
+ "md": 0.5,
465
+ "lg": 0.5,
466
+ "xl": 0.5,
467
+ "style": {
468
+ "marginTop": "50px"
469
+ }
470
+ },
454
471
  "outro": {
455
472
  "type": "staticText",
456
- "text": "<br>Team inventwo • <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a> • by skvarel",
473
+ "text": "Team inventwo • <a href=\"https://github.com/inventwo\">https://github.com/inventwo</a> • by skvarel",
457
474
  "newLine": true,
458
- "sm": 12,
459
- "xs": 12,
460
- "md": 12,
461
- "lg": 12,
462
- "xl": 12,
475
+ "sm": 3,
476
+ "xs": 3,
477
+ "md": 3,
478
+ "lg": 3,
479
+ "xl": 3,
463
480
  "style": {
464
481
  "borderTop": "1px solid",
465
- "borderRadius": "0px",
466
- "marginTop": "50px",
467
- "fontSize": "14px"
482
+ "borderColor": "",
483
+ "marginTop": "0px",
484
+ "paddingTop": "5px",
485
+ "fontSize": "14px",
486
+ "textAlign": "left"
468
487
  }
469
488
  },
470
- "logo": {
471
- "type": "staticImage",
472
- "src": "inventwo.svg",
489
+ "payPal": {
490
+ "type": "staticLink",
491
+ "href": "https://www.paypal.com/donate/?hosted_button_id=7W6M3TFZ4W9LW",
492
+ "target": "_blank",
493
+ "label": "paypal_donate",
494
+ "variant": "outlined",
495
+ "button": true,
496
+ "icon": "https://www.paypalobjects.com/marketing/web/logos/paypal-mark-color_new.svg",
473
497
  "newLine": true,
474
- "sm": 1,
475
- "xs": 1,
476
- "md": 1,
477
- "lg": 1,
478
- "xl": 1,
498
+ "sm": 3,
499
+ "xs": 3,
500
+ "md": 3,
501
+ "lg": 3,
502
+ "xl": 3,
479
503
  "style": {
480
- "marginTop": "5px",
481
- "textAlign": "center"
504
+ "marginTop": "0px"
482
505
  }
483
506
  }
484
507
  }
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "autodarts",
4
- "version": "0.6.2",
4
+ "version": "0.7.0",
5
5
  "news": {
6
+ "0.7.0": {
7
+ "en": "Added: New `status.boardStatus` state. Status indicator of board event (e.g. `\"Stopped\"`, `\"Calibration finished\"`, `\"Started\"`).",
8
+ "de": "Hinzugefügt: Neu `status.boardStatus` Zustand. Statusanzeige des Board-Events (z.B. \"Stopped\", \"Calibration fertig\", \"Started\"\").",
9
+ "ru": "Добавлено: Новое состояние \"status.boardStatus\". Индикатор состояния события на борту (например, \"Остановилось\", \"Калибровка завершена\", \"Начало\").",
10
+ "pt": "Adicionado: Novo estado `status.boardStatus`. Indicador de estado do evento de tabuleiro (por exemplo, `\"Parado\"`, `\"A calibração terminou\"`, `\"Iniciado\"`).",
11
+ "nl": "Toegevoegd: Nieuwe status.boardStatus Status-indicator van de gebeurtenis van het bord (bv. \"Stopped,\" \"Calibration finished\" en \"Started\").",
12
+ "fr": "Ajouté : Nouveau état `status.boardStatus`. Indicateur de l'état de l'événement du conseil d'administration (par exemple, ``Stopupped'``, `'Calibration terminée'`, `'Started'`).",
13
+ "it": "Aggiunto: New `status.boardStatus` state. Indicatore di stato dell'evento di bordo (ad esempio `\"Stopped\"`, `\"Calibrazione finita\"`, `\"Started\"`).",
14
+ "es": "Añadido: Nuevo estado de `status.boardStatus`. Indicador de estado del evento de la junta (por ejemplo, `\"Stopped\"`, `\"Calibration completed\" `, `\"Started').",
15
+ "pl": "Dodano: Nowy stan 'status.boardStatus'. Wskaźnik stanu zdarzenia planszowego (np. \"Zatrzymał\", \"Kalibracja zakończona\", \"Rozpoczęty\").",
16
+ "uk": "Додано: Новий стан `status.boardStatus`. Індикатор стану походу дошки (наприклад, ```'', ''''''', '''''''.",
17
+ "zh-cn": "添加:新的`状态.boardstatus'状态。 板块事件的状况指标(例如`停止'、`完成的校准'、`开始')."
18
+ },
19
+ "0.6.3": {
20
+ "en": "Improved: Connection handling now uses `info.connection` and clearly marks the adapter as offline when the Autodarts Board Manager is not reachable (including better timeout/ECONNRESET handling).\nChanged: Reduced log noise when the board is offline – only one warning is logged when the connection is lost, subsequent timeouts are written as debug messages.\nImproved: Minor tweaks to the HELP & FAQ tab texts and configuration descriptions.",
21
+ "de": "Verbessert: Die Verbindungshandhabung nutzt jetzt `info.connection` und markiert den Adapter als offline, wenn der Autodarts Board Manager nicht erreichbar ist (einschließlich besserer Timeout/ECONNRESET Handling).\nGeändert: Reduziertes Log-Rausch, wenn das Board offline ist – nur eine Warnung wird eingeloggt, wenn die Verbindung verloren ist, werden nachfolgende Timeouts als Debug-Nachrichten geschrieben.\nVerbessert: Minor tweaks auf die Registerkarte HELP & FAQ Texte und Konfigurationsbeschreibungen.",
22
+ "ru": "Улучшенная: обработка соединения теперь использует «info.connection» и четко обозначает адаптер как автономный, когда до менеджера совета директоров Autodarts не достижимо (включая лучшую обработку тайм-аута / ECONNRESET).\nИзменилось: Сниженный лог-шум при отключении платы — регистрируется только одно предупреждение при потере соединения, последующие тайм-ауты записываются как сообщения отладки.\nУлучшение: Незначительные изменения в текстах вкладок HELP & FAQ и описаниях конфигурации.",
23
+ "pt": "Melhorado: O manuseio da conexão agora usa `info.connection` e marca claramente o adaptador como offline quando o Autodarts Board Manager não é acessível (incluindo melhor timeout/ECONNRESET).\nAlterado: Ruído de log reduzido quando o tabuleiro está offline – apenas um aviso é registrado quando a conexão é perdida, os prazos subsequentes são escritos como mensagens de depuração.\nMelhorado: Pequenos ajustes nos textos da aba Ajuda & FAQ e descrições de configuração.",
24
+ "nl": "Verbeterd: Verbindingsafhandeling maakt nu gebruik van .\nGewijzigd: Minder logruis wanneer het bord offline is .\nBeter: Kleine aanpassingen aan het HELP & FAQ-tabblad teksten en configuratiebeschrijvingen.",
25
+ "fr": "Amélioration : La gestion de la connexion utilise désormais `info.connection` et marque clairement l'adaptateur comme hors ligne lorsque le gestionnaire de conseil d'administration Autodarts n'est pas accessible (y compris une meilleure gestion timeout/ECONNESET).\nChangement : Diminution du bruit de log lorsque la carte est hors ligne – un seul avertissement est enregistré lorsque la connexion est perdue, les timeouts ultérieurs sont écrits comme des messages de débogage.\nAmélioration : Modifications mineures aux textes de l'onglet HELP & FAQ et aux descriptions de configuration.",
26
+ "it": "Migliorata: la gestione della connessione utilizza ora `info.connection` e contrassegna chiaramente l'adattatore come offline quando il Manager di bordo di Autodarts non è raggiungibile (compreso il timeout migliore / ECONNRESET di gestione).\nCambiato: Riduzione del rumore di registro quando la scheda è offline – solo un avviso viene registrato quando la connessione viene persa, i timeout successivi vengono scritti come messaggi di debug.\nMigliorato: Tagli minori ai testi della scheda HELP & FAQ e descrizioni delle configurazioni.",
27
+ "es": "Mejorado: el manejo de conexión ahora utiliza 'info.connection' y claramente marca el adaptador como offline cuando el Administrador de la Junta de Autodarts no es accesible (incluyendo un mejor tiempo / manejo de ECNNRESET).\nCambio: El ruido de registro reducido cuando el tablero está fuera de línea – sólo una advertencia se registra cuando la conexión se pierde, los plazos posteriores se escriben como mensajes de depuración.\nMejorado: Ajustes menores a los textos de pestañas HELP & FAQ y descripciones de configuración.",
28
+ "pl": "Ulepszone: Obsługa połączeń używa teraz 'info.connection' i wyraźnie oznacza, że adapter jest offline, gdy menedżer Zarządu Autodarts nie jest osiągalny (w tym lepszy czas / obsługa ECONNRESET).\nZmieniono: Zmniejszony hałas logowania, gdy deska jest offline - tylko jedno ostrzeżenie jest logowane, gdy połączenie jest utracone, kolejne timeout są zapisywane jako wiadomości debugowania.\nPoprawa: Drobne poprawki do tekstów zakładek HELP & FAQ i opisów konfiguracji.",
29
+ "uk": "Удосконалено: З'єднання, що працює зараз, використовує `info.connection` і чітко позначається перехідник в автономному режимі, коли Менеджер по роботі з клієнтами Autodarts не досягається (включаючи кращий час / ECONNRESET).\nЗмінено: Зменшення шуму логіну, коли плата відсутня – тільки одна попередження ввійде, коли з'єднання втрачено, подальші часові маршрути письмові як дебвугові повідомлення.\nПокращений: Ми можемо самі зателефонувати одержувачу і узгодити зручний час.",
30
+ "zh-cn": "改进:连接处理现在使用“info.connection”,并在自动调试板管理员无法到达时(包括更好的超时/ECONRESET处理)将适配器明确标记为离线.\n已更改 : 当棋盘下线时减少日志噪声——当连接丢失时只记录一个警告,随后的超时被写成调试消息.\n改进: 微调到 Help & FAQ 标签文本和配置描述 ."
31
+ },
6
32
  "0.6.2": {
7
33
  "en": "Improved: Settings page reworked to use three tabs (`OPTIONS`, `MAPPINGS` and `HELP & FAQ`) for better clarity.",
8
34
  "de": "Verbessert: Einstellungen Seite neu bearbeitet, um drei Registerkarten (`OPTIONS`, `MAPPINGS` und `HELP & FAQ`) für bessere Klarheit zu verwenden.",
@@ -67,32 +93,6 @@
67
93
  "pl": "Dodano: dwukierunkowa kontrola sprzętowa stanów 'system.hardware.light' i 'system.hardware.power'\nDodano: Opcje konfiguracji do mapowania stanów światła / mocy do zewnętrznych stanów jOBroker (np. 0 _ userdata)\nZmiana: Stan sprzętu obsługuje teraz operacje odczytu / zapisu dla pełnej automatyzacji integracji",
68
94
  "uk": "Додано: Двосторонні стани керування обладнанням `system.hardware.light` і `system.hardware.power й\nДодано: Параметри конфігурації для мапи світло/потужних станів на зовнішні стани ioBroker (наприклад, 0_userdata)\nЗмінено: Апаратні стани, які зараз підтримують операції читання/запису для повної інтеграції автоматизації",
69
95
  "zh-cn": "添加:双向硬件控制状态为‘system.hardware.light'和‘system.hardware.power. `\n添加: 将光/ 电状态映射到外部 ioBroker 状态的配置选项( 如 0_ userdata)\n更改: 硬件状态现在支持读/写操作,以便完全自动化集成"
70
- },
71
- "0.4.0": {
72
- "en": "Changed: Restructured system information into dedicated `system.hardware`, `system.software` and `system.cams` channels.\nAdded: New software info states (`desktopVersion`, `boardVersion`, `platform`, `os`) and hardware info states (`kernelArch`, `cpuModel`, `hostname`).\nAdded: Camera configuration states `system.cams.cam0/1/2` containing JSON with width, height and fps.\nChanged: Adapter configuration for polling interval and triple trigger thresholds is now fully driven via jsonConfig (dropdowns and number fields).\nRemoved: Experimental light/power alias mapping from internal logic (no user-visible feature was released).",
73
- "de": "Geändert: Restrukturierte Systeminformationen in dedizierte `system.hardware`, `system.software` und `system.cams` Kanäle.\nHinzugefügt: Neue Software-Info-Zustände (`desktopVersion`, `boardVersion`, `platform`, `os`) und Hardware-Info-Zustände (`kernelArch`, `cpuModel`, `hostname`).\nHinzugefügt: Kamera-Konfigurationszustände `system.cams.cam0/1/2` mit JSON mit Breite, Höhe und fps.\nGeändert: Adapterkonfiguration für das Abfrageintervall und die dreifachen Triggerschwellen werden nun über jsonConfig (Dropdowns und Nummernfelder) voll angesteuert.\nEntfernt: Experimentelles Licht/Power Alias Mapping aus interner Logik (keine Benutzersichtbarkeit wurde freigegeben).",
74
- "ru": "Изменение: реструктурированная системная информация в выделенные каналы «system.hardware», «system.software» и «system.cams».\nДобавлено: Новые состояния информации о программном обеспечении («desktopVersion», «boardVersion», «платформа», «os») и состояния информации о аппаратном обеспечении («kernelArch», «cpuModel», «hostname»).\nДобавлено: В конфигурации камеры указано \"system.cams.cam0/1/2\", содержащее JSON с шириной, высотой и fps.\nИзмененная конфигурация адаптера для интервала опроса и тройных триггерных порогов теперь полностью приводится в действие через jsonConfig (выпадения и числовые поля).\nУдалено: Экспериментальное отображение света/мощности по внутренней логике (не было выпущено никаких видимых пользователем функций).",
75
- "pt": "Modificado: Informações do sistema reestruturadas em `system.hardware` dedicado, `system.software' e `system.cams' canais.\nAdicionado: Novos estados de informação de software (`desktopVersion`, `boardVersion`, `platform`, `os`) e estados de informação de hardware (`kernelArch`, `cpuModel`, `hostname`).\nAdicionado: Os estados de configuração da câmera `system.cams.cam0/1/2` contendo JSON com largura, altura e fps.\nModificado: A configuração do adaptador para o intervalo de votação e limiares triplos de gatilho é agora totalmente conduzida através do jsonConfig (dropdowns e campos numéricos).\nRemovido: Mapeamento de alias de luz/potência experimental da lógica interna (nenhum recurso visível pelo usuário foi lançado).",
76
- "nl": "Veranderd: Gestructureerde systeeminformatie in dedicated .\nToegevoegd: Nieuwe software info states (.\nToegevoegd: Camera-configuratie staat voor \"system.cams.cam0/1/2.\nGewijzigd: Adapterconfiguratie voor polling interval en triple trigger drempels is nu volledig gedreven via jsonConfig (dropdowns en nummervelden).\nVerwijderd: Experimenteel licht/kracht alias mapping van interne logica (er werd geen gebruikerszichtbare functie vrijgegeven).",
77
- "fr": "Changed: Restructuration des informations système en canaux dédiés `system.hardware`, `system.software` et `system.cams`.\nAjouté : Nouveaux états d'information logicielle (`desktopVersion`, `boardVersion`, `platform`, `os`) et états d'information matérielle (`kernelArch`, `cpuModel`, `hostname`).\nAjouté: La configuration de la caméra indique `system.cams.cam0/1/2` contenant JSON avec largeur, hauteur et fps.\nChanged: La configuration de l'adaptateur pour l'intervalle de vote et les seuils de triple déclenchement est maintenant entièrement pilotée via jsonConfig (champs déroulants et nombres).\nSupprimé: Carte expérimentale alias lumière/puissance à partir de la logique interne (aucune fonctionnalité visible par l'utilisateur n'a été publiée).",
78
- "it": "Modificato: informazioni di sistema ristrutturate nei canali `system.hardware` dedicati, `system.software` e `system.cams`.\nAggiunto: Nuovo software info stati (`desktopVersion`, `boardVersion`, `platform`, `os`) e dati hardware stati (`kernelArch`, `cpuModel`, `hostname`).\nAggiunto: Configurazione della fotocamera stati `system.cams.cams.cam0/1/2` contenente JSON con larghezza, altezza e fps.\nModificato: la configurazione dell'adattatore per l'intervallo di polling e le soglie di trigger triple è ora completamente guidata tramite jsonConfig (dropdown e campi numerici).\nRimuoveto: Sperimentale mappatura alias della luce dalla logica interna (non è stata rilasciata alcuna funzione visibile dall'utente).",
79
- "es": "Cambio: información reestructurada del sistema en canales dedicados `system.hardware`, `system.software` y `system.cams`.\nAñadido: New software info states (`desktopVersion`, `boardVersion`, `platform`, `os`) and hardware info states (`kernelArch`, `cpuModel`, `hostname`).\nAñadido: configuración de la cámara estados `system.cams.cam0/1/2` que contienen JSON con ancho, altura y fps.\nCambio: la configuración del adaptador para intervalos de votación y los umbrales de triple disparador ahora se conduzcan completamente a través de jsonConfig (dropdowns y campos de números).\nEliminado: Experimental light/power alias mapping from internal logic (no user-visible feature was released).",
80
- "pl": "Zmienione: Przekształcone informacje systemowe na dedykowane kanały \"system.hardware\", \"system.software\" i \"system.cams\".\nDodano: nowe stany informatyczne oprogramowania ('desktopVersion', 'boardVersion', 'platform', 'os') oraz stany informacyjne sprzętu ('kernelArch', 'cpuModel', 'hostname').\nDodano: Konfiguracja kamery stanowi system.cams.cam0 / 1 / 2 'zawierający JSON o szerokości, wysokości i fps.\nZmieniona: Konfiguracja adaptera dla interwałów wyborczych i potrójnych progów wyzwalających jest teraz w pełni napędzana przez jsonConfig (zrzuty i pola liczbowe).\nUsunięty: Experimental light / power alias mapowanie z wewnętrznej logiki (nie została wydana żadna widoczna funkcja użytkownika).",
81
- "uk": "Змінено: Реструктуризація інформації про систему у виділених `system.hardware`, `system.software` та `system.cams`.\nДодано: Нові інформаційні стани програмного забезпечення (`desktopVersion`, `boardVersion`, `platform`, `os`) та апаратні засоби (`kernelArch`, `cpuModel`, `hostname`).\nДодано: Налаштування камери стани `system.cams.cam0/1/2`, що містять JSON з шириною, висотою і fps.\nЗмінено: Налаштування адаптера для інтервалу опитування та потрійних порогів тригера тепер повністю керована за допомогою jsonConfig (розгортання та кількість полів).\nВидалено: Експериментальні джерела світла/power alias з внутрішньої логіки (без функції користувача).",
82
- "zh-cn": "更改:将系统信息结构改为专用的`系统.硬件'、`系统.软件'和`系统.摄像头'频道.\n添加:新的软件信息状态(`台式计算机Version'、`boardVersion'、`平台'、`os')和硬件信息状态(`内核Arch'、`cpuModel'、`hostname').\n添加:相机配置为`system.cams.cam0/1/2',内含JSON,宽度,高度和fps.\n更改:用于投票间隔和三重触发阈值的适配器配置现在通过jsonConfig(滴落和数字字段)完全驱动.\n删除:实验光/功率别名从内部逻辑映射(没有发布用户可见特性)."
83
- },
84
- "0.3.3": {
85
- "en": "Changed: Configuration fields interval and triggerReset now use seconds instead of milliseconds in the admin UI.",
86
- "de": "Geändert: Konfiguration Felder Intervall und TriggerReset verwenden jetzt Sekunden statt Millisekunden im Admin UI.",
87
- "ru": "Изменение: интервалы полей конфигурации и триггер сброс теперь используют секунды вместо миллисекунд в пользовательском интерфейсе администратора.",
88
- "pt": "Modificado: Intervalo de campos de configuração e gatilhoReset agora use segundos em vez de milissegundos na interface de administração.",
89
- "nl": "Gewijzigd: Configuratievelden interval en triggerReset gebruikt nu seconden in plaats van milliseconden in de admin UI.",
90
- "fr": "Changed: Champs de configuration intervalle et triggerReset maintenant utiliser secondes au lieu de millisecondes dans l'interface utilisateur admin.",
91
- "it": "Modificato: intervallo di campi di configurazione e triggerReset ora utilizzare secondi invece di millisecondi nell'interfaccia utente di amministrazione.",
92
- "es": "Cambio: intervalo de campos de configuración y gatilloReset ahora use segundos en lugar de milisegundos en la interfaz de administración.",
93
- "pl": "Zmieniony: Przedział pól konfiguracyjnych i tryggerReset używają teraz sekund zamiast milisekund w interfejsu administratora.",
94
- "uk": "Змінено: інтервал конфігураційних полів і тригерЗмінити зараз за допомогою секунд замість мілісекундів в адмін UI.",
95
- "zh-cn": "已更改: 配置字段间隔和触发 Reset 现在在管理员UI中使用秒而不是毫秒 ."
96
96
  }
97
97
  },
98
98
  "titleLang": {
package/main.js CHANGED
@@ -14,11 +14,15 @@ class Autodarts extends utils.Adapter {
14
14
  name: "autodarts",
15
15
  });
16
16
 
17
+ this.isConnected = false;
18
+ this.pollTimer = null;
19
+ this.onlineIntervalMs = 1000; // Platzhalter, wird in onReady gesetzt
20
+ this.offlineIntervalMs = 60000; // z.B. 60 s
21
+
17
22
  this.on("ready", this.onReady.bind(this));
18
23
  this.on("stateChange", this.onStateChange.bind(this));
19
24
  this.on("unload", this.onUnload.bind(this));
20
25
 
21
- this.pollTimer = null;
22
26
  this.lastThrowsCount = 0; // Anzahl Darts im aktuellen Visit
23
27
  this.lastSignature = ""; // Verhindert doppelte Verarbeitung gleicher Würfe
24
28
  this.offline = false;
@@ -35,6 +39,20 @@ class Autodarts extends utils.Adapter {
35
39
  async onReady() {
36
40
  this.log.info("Autodarts adapter started");
37
41
 
42
+ // Initial connection state
43
+ await this.extendObjectAsync("info.connection", {
44
+ type: "state",
45
+ common: {
46
+ name: "Connected to Autodarts Board Manager",
47
+ type: "boolean",
48
+ role: "indicator.connected",
49
+ read: true,
50
+ write: false,
51
+ },
52
+ native: {},
53
+ });
54
+ await this.setStateAsync("info.connection", false, true);
55
+
38
56
  // Defaults aus io-package.json absichern
39
57
  this.config.host ??= "127.0.0.1";
40
58
  this.config.port ??= 3180;
@@ -42,6 +60,8 @@ class Autodarts extends utils.Adapter {
42
60
  this.config.tripleMinScore ??= 1;
43
61
  this.config.tripleMaxScore ??= 20;
44
62
  this.config.triggerResetSec ??= 0; // 0 = kein Auto-Reset
63
+ // Polling-Intervall aus Sekunden in Millisekunden berechnen
64
+ this.onlineIntervalMs = (Number(this.config.intervalSec) || 1) * 1000;
45
65
 
46
66
  // Visit-Struktur anlegen (ausgelagert)
47
67
  await visit.init(this);
@@ -68,6 +88,25 @@ class Autodarts extends utils.Adapter {
68
88
  },
69
89
  native: {},
70
90
  });
91
+ // status.board als String-Datenpunkt im bestehenden status-Channel anlegen
92
+ await this.extendObjectAsync("status.boardStatus", {
93
+ type: "state",
94
+ common: {
95
+ name: {
96
+ en: "Board event status",
97
+ de: "Board-Ereignis-Status",
98
+ },
99
+ type: "string",
100
+ role: "info",
101
+ read: true,
102
+ write: false,
103
+ desc: {
104
+ en: "Current event value from /api/state",
105
+ de: "Aktueller event-Wert aus /api/state",
106
+ },
107
+ },
108
+ native: {},
109
+ });
71
110
  // System-Channel und BoardVersion-Datenpunkt anlegen
72
111
  await this.extendObjectAsync("system", {
73
112
  type: "channel",
@@ -440,12 +479,8 @@ class Autodarts extends utils.Adapter {
440
479
  this.lastThrowsCount = 0;
441
480
  this.lastSignature = "";
442
481
 
443
- // Polling-Intervall aus Sekunden in Millisekunden umrechnen
444
- const pollIntervalMs = (Number(this.config.intervalSec) || 1) * 1000;
445
-
446
482
  // Polling starten
447
- this.pollTimer = setInterval(() => this.fetchState(), pollIntervalMs);
448
- this.fetchState();
483
+ this.pollLoop();
449
484
 
450
485
  // Host-Informationen und Kameras abfragen und alle 5 Minuten aktualisieren
451
486
  this.fetchHost();
@@ -553,11 +588,14 @@ class Autodarts extends utils.Adapter {
553
588
  const data = await httpHelper.makeRequest(this, "/api/state");
554
589
 
555
590
  // Log wenn Verbindung wiederhergestellt wurde
556
- if (this.offline) {
591
+ if (this.offline || !this.isConnected) {
557
592
  this.log.info("Autodarts connection restored");
558
593
  }
559
594
  this.offline = false;
560
- await this.setStateAsync("online", true, true); // Server erreichbar
595
+ this.isConnected = true;
596
+
597
+ await this.setStateAsync("online", true, true); // eigener Online-State
598
+ await this.setStateAsync("info.connection", true, true); // Admin-Status
561
599
 
562
600
  try {
563
601
  const state = JSON.parse(data);
@@ -569,6 +607,14 @@ class Autodarts extends utils.Adapter {
569
607
  await trafficLight.setStatus(this, "yellow");
570
608
  }
571
609
 
610
+ // Nur event-Wert in status.boardStatus schreiben
611
+ if (state.event !== undefined) {
612
+ await this.setStateAsync("status.boardStatus", {
613
+ val: state.event,
614
+ ack: true,
615
+ });
616
+ }
617
+
572
618
  // Nur weiter, wenn throws existieren, Array ist und nicht leer
573
619
  if (!state.throws || !Array.isArray(state.throws) || state.throws.length === 0) {
574
620
  return;
@@ -601,15 +647,52 @@ class Autodarts extends utils.Adapter {
601
647
  await this.setStateAsync("online", true, true);
602
648
  }
603
649
  } catch (error) {
604
- if (!this.offline) {
605
- this.log.warn(`Autodarts not reachable: ${error.message}`);
606
- this.offline = true;
650
+ const msg = error?.message || String(error);
651
+ const code = error?.code;
652
+
653
+ const isNetErr =
654
+ code === "ECONNREFUSED" ||
655
+ code === "ETIMEDOUT" ||
656
+ code === "EHOSTUNREACH" ||
657
+ msg.includes("timeout") ||
658
+ msg.includes("ECONNRESET");
659
+
660
+ if (isNetErr) {
661
+ if (!this.offline) {
662
+ this.log.warn(`Autodarts not reachable: ${msg}`);
663
+ this.offline = true;
664
+ } else {
665
+ this.log.debug(`Autodarts still offline: ${msg}`);
666
+ }
667
+
668
+ this.isConnected = false;
669
+ await trafficLight.setStatus(this, "red");
670
+ await this.setStateAsync("online", false, true);
671
+ await this.setStateAsync("info.connection", false, true);
672
+ await this.setStateAsync("status.boardStatus", {
673
+ val: "offline",
674
+ ack: true,
675
+ });
676
+ } else {
677
+ this.log.error(`Autodarts request failed: ${msg}`);
678
+ // Bei anderen Fehlern (z.B. Syntax) nicht auf "offline" setzen
679
+ // Optional: hier trotzdem online = false setzen, wenn gewünscht
607
680
  }
608
- await trafficLight.setStatus(this, "red"); // Ampel = rot
609
- await this.setStateAsync("online", false, true); // Server offline
610
681
  }
611
682
  }
612
683
 
684
+ scheduleNextPoll() {
685
+ const delay = this.isConnected ? this.onlineIntervalMs : this.offlineIntervalMs;
686
+ this.pollTimer = this.setTimeout(() => this.pollLoop(), delay);
687
+ }
688
+
689
+ async pollLoop() {
690
+ await this.fetchState().catch(() => {
691
+ // Fehler werden in fetchState geloggt
692
+ });
693
+ this.scheduleNextPoll();
694
+ }
695
+
613
696
  /**
614
697
  * Board-Konfiguration abfragen (Kameras)
615
698
  */
@@ -701,7 +784,7 @@ class Autodarts extends utils.Adapter {
701
784
  onUnload(callback) {
702
785
  try {
703
786
  if (this.pollTimer) {
704
- clearInterval(this.pollTimer);
787
+ clearTimeout(this.pollTimer);
705
788
  }
706
789
  if (this.versionTimer) {
707
790
  clearInterval(this.versionTimer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.autodarts",
3
- "version": "0.6.2",
3
+ "version": "0.7.0",
4
4
  "description": "Autodarts Autoscoring",
5
5
  "author": "skvarel <skvarel@inventwo.com>",
6
6
  "contributors": [