iobroker.anthbot-genie 0.1.0 → 0.1.2

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
@@ -9,17 +9,19 @@
9
9
  ![GitHub release](https://img.shields.io/github/v/release/reloxx13/ioBroker.anthbot-genie)
10
10
  ![License](https://img.shields.io/github/license/reloxx13/ioBroker.anthbot-genie)
11
11
  ![ioBroker phase](https://img.shields.io/badge/ioBroker%20phase-testing-yellow)
12
- [![ioBroker forum](https://img.shields.io/badge/ioBroker-forum-blue)](https://forum.iobroker.net/topic/84392/test-adapter-anthbot-genie-v0.0.x-npm-github)
12
+ [![ioBroker forum](https://img.shields.io/badge/ioBroker-forum-blue)](https://forum.iobroker.net/topic/84392)
13
13
 
14
14
  [![NPM](https://nodei.co/npm/iobroker.anthbot-genie.png?downloads=true)](https://nodei.co/npm/iobroker.anthbot-genie/)
15
15
 
16
- Unofficial ioBroker adapter for [Anthbot Genie robotic lawn mowers](https://de.anthbot.com/products/genie-mahroboter).
16
+ Unofficial ioBroker adapter for [Anthbot Genie robotic lawn mowers](https://de.anthbot.com/products/genie-mahroboter), focused on detailed Genie telemetry, diagnostics, and mower control.
17
17
 
18
- The adapter connects to the Anthbot cloud account, discovers bound mowers, reads cloud and IoT shadow data, and exposes status, settings, mower commands, zone data, and raw diagnostic payloads in ioBroker.
18
+ The adapter connects to the Anthbot cloud account, discovers bound mowers, reads cloud and IoT shadow data, and exposes a broad state tree for status, settings, mower commands, zone data, consumables, location, diagnostics, and raw troubleshooting payloads in ioBroker.
19
19
 
20
- This adapter is currently in testing. Please report feedback and test results in the [ioBroker forum Test Adapter anthbot-genie v0.0.x npm/GitHub thread](https://forum.iobroker.net/topic/84392/test-adapter-anthbot-genie-v0.0.x-npm-github).
20
+ It is intended for users who want more than a basic online/battery/status view: RTK and base station state, firmware and OTA details, network and SIM information, GPS and pose data, map lifecycle timestamps, mower error details, consumable lifetimes, rain settings, zone metadata, and writable mowing controls are exposed as ioBroker states.
21
21
 
22
- An example ioBroker Blockly with conditions for mower automation is available in the [Blockly automation example](https://forum.iobroker.net/topic/84392/test-adapter-anthbot-genie-v0.0.x-npm-github/2?_=1777117406598).
22
+ This adapter is currently in testing. Please report feedback and test results in the [ioBroker forum test thread](https://forum.iobroker.net/topic/84392).
23
+
24
+ An example ioBroker Blockly with conditions for mower automation is available in the [Blockly automation example](https://forum.iobroker.net/topic/84392/2).
23
25
 
24
26
  ## Features
25
27
 
@@ -27,12 +29,14 @@ An example ioBroker Blockly with conditions for mower automation is available in
27
29
  - Automatic discovery of mowers bound to the configured Anthbot account
28
30
  - Region and IoT endpoint lookup per mower
29
31
  - Polling of property and service shadows
30
- - Status states for connection, online state, battery, mower status, charging state, mowing time, mowing area, map, error, and consumable lifetime
31
- - Diagnostic states for RTK, firmware, OTA, network, GPS/location, map lifecycle, and mower error data
32
- - Writable control states for full-map mowing, zone mowing, cutting height, voice volume, custom mowing direction, rain settings, and mowing near the charging pile
33
- - Command states for full mowing, stop, return to dock, pause return to dock, grass dump, disk maintenance mode, edge mowing, mowing near the charging pile, refresh, manual zone mowing, and automatic zone mowing
34
- - Manual and automatic zone metadata as JSON states
35
- - Raw property, service, and area payloads for troubleshooting
32
+ - Detailed status states for connection, online state, battery, mower status, charging state, mowing time, mowing area, map status, errors, active mowing mode, point mowing, and zone counts
33
+ - Diagnostic states for RTK fix, RTK base station, moved antenna warnings, firmware versions, OTA progress, WiFi, cellular, SIM, Bluetooth, camera/map flags, obstacle avoidance, security flags, system timestamps, and mower error data
34
+ - Location states for anti-loss GPS coordinates and local mower pose
35
+ - Consumable lifetime states and reset buttons for charging port, cameras, and blades
36
+ - Writable control states for full-map mowing, zone mowing, cutting height, voice volume, custom mowing direction, obstacle avoidance, rain settings, and mowing near the charging pile
37
+ - Command states for full mowing, stop, return to dock, pause return to dock, grass dump, disk maintenance mode, edge mowing, mowing near the charging pile, point mowing, refresh, manual zone mowing, and automatic zone mowing
38
+ - Manual and automatic zone metadata as JSON states, including active manual zone IDs
39
+ - Raw property shadow, service shadow, and area definition payloads for troubleshooting and automation debugging
36
40
 
37
41
  ## Requirements
38
42
 
@@ -271,6 +275,17 @@ This ioBroker adapter is an independent project, but it builds on public API res
271
275
 
272
276
  ### **WORK IN PROGRESS**
273
277
 
278
+ ### 0.1.2
279
+
280
+ - Limit `io-package.json` news entries for the ioBroker repository builder.
281
+
282
+ ### 0.1.1
283
+
284
+ - Fix consumable lifetime mapping to match the Anthbot app labels: blades, cameras, and charging port.
285
+ - Highlight the extended telemetry, diagnostics, controls, and raw payload coverage in the README.
286
+ - Clean up repository readiness metadata and poll timer handling for ioBroker best practices.
287
+ - Align consumable lifetime and network diagnostic state roles with the documented ioBroker state role list.
288
+
274
289
  ### 0.1.0
275
290
 
276
291
  - Add expanded diagnostics for model names, region fallback, errors, RTK, map, firmware, OTA, network, and GPS/location data.
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "anthbot-genie",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "news": {
6
+ "0.1.2": {
7
+ "en": "Limit io-package news entries for the ioBroker repository builder.",
8
+ "de": "Anzahl der io-package-News-Einträge für den ioBroker-Repository-Builder begrenzt.",
9
+ "ru": "Ограничено количество записей io-package news для сборщика репозитория ioBroker.",
10
+ "pt": "Limitado o número de entradas de news do io-package para o construtor do repositório ioBroker.",
11
+ "nl": "Aantal io-package news-items beperkt voor de ioBroker repository builder.",
12
+ "fr": "Limitation du nombre d'entrées news dans io-package pour le générateur de dépôt ioBroker.",
13
+ "it": "Limitato il numero di voci news in io-package per il builder del repository ioBroker.",
14
+ "es": "Limitado el número de entradas news de io-package para el generador del repositorio ioBroker.",
15
+ "pl": "Ograniczono liczbę wpisów news w io-package dla buildera repozytorium ioBroker.",
16
+ "uk": "Обмежено кількість записів news в io-package для збирача репозиторію ioBroker.",
17
+ "zh-cn": "限制 io-package news 条目数量以适配 ioBroker 仓库构建器。"
18
+ },
19
+ "0.1.1": {
20
+ "en": "Fix consumable lifetime mapping so blades, cameras, and charging port match the Anthbot app.\nHighlight extended telemetry, diagnostics, controls, and raw payload coverage in the README.\nClean up repository readiness metadata and poll timer handling.",
21
+ "de": "Zuordnung der Verbrauchsmaterial-Lebensdauer korrigiert, sodass Klingen, Kameras und Ladeport mit der Anthbot-App übereinstimmen.\nErweiterte Telemetrie, Diagnose, Steuerungen und Rohdatenabdeckung in der README hervorgehoben.\nRepository-Metadaten und Poll-Timer-Verhalten bereinigt.",
22
+ "ru": "Исправлено сопоставление срока службы расходников, чтобы лезвия, камеры и зарядный порт соответствовали приложению Anthbot.\nВ README выделены расширенная телеметрия, диагностика, элементы управления и необработанные данные.\nОчищены метаданные готовности репозитория и обработка таймера опроса.",
23
+ "pt": "Corrigido o mapeamento da vida útil dos consumíveis para que lâminas, câmeras e porta de carregamento correspondam ao app Anthbot.\nDestacada no README a cobertura ampliada de telemetria, diagnóstico, controles e dados brutos.\nMetadados de prontidão do repositório e temporizador de polling ajustados.",
24
+ "nl": "Mapping van verbruiksl levensduur gecorrigeerd zodat messen, camera's en laadpoort overeenkomen met de Anthbot-app.\nUitgebreide telemetrie, diagnostiek, bediening en ruwe payloads duidelijker in de README gezet.\nRepository-readinessmetadata en polltimer-afhandeling opgeschoond.",
25
+ "fr": "Correction du mappage de la durée de vie des consommables afin que les lames, caméras et port de charge correspondent à l'application Anthbot.\nMise en avant dans le README de la télémétrie, des diagnostics, des contrôles et des données brutes étendus.\nNettoyage des métadonnées de dépôt et de la gestion du minuteur de polling.",
26
+ "it": "Corretto il mapping della vita utile dei consumabili in modo che lame, fotocamere e porta di ricarica corrispondano all'app Anthbot.\nEvidenziata nel README la copertura estesa di telemetria, diagnostica, controlli e payload grezzi.\nRipuliti i metadati di repository readiness e la gestione del timer di polling.",
27
+ "es": "Corregido el mapeo de vida útil de consumibles para que cuchillas, cámaras y puerto de carga coincidan con la app Anthbot.\nDestacada en el README la cobertura ampliada de telemetría, diagnóstico, controles y datos sin procesar.\nLimpiados los metadatos de preparación del repositorio y el manejo del temporizador de sondeo.",
28
+ "pl": "Poprawiono mapowanie żywotności materiałów eksploatacyjnych, aby ostrza, kamery i port ładowania odpowiadały aplikacji Anthbot.\nW README podkreślono rozszerzoną telemetrię, diagnostykę, sterowanie i surowe dane.\nUporządkowano metadane gotowości repozytorium i obsługę timera odpytywania.",
29
+ "uk": "Виправлено зіставлення ресурсу витратних матеріалів, щоб леза, камери й зарядний порт відповідали застосунку Anthbot.\nУ README підкреслено розширену телеметрію, діагностику, керування та сирі дані.\nОчищено метадані готовності репозиторію та обробку таймера опитування.",
30
+ "zh-cn": "修正耗材寿命映射,使刀片、摄像头和充电端口与 Anthbot 应用一致。\n在 README 中突出扩展的遥测、诊断、控制和原始数据覆盖。\n清理仓库就绪元数据和轮询计时器处理。"
31
+ },
6
32
  "0.1.0": {
7
33
  "en": "Add expanded diagnostics, grouped state layout, consumable resets, mower action commands, and writable mowing controls.\nAdd full-map edge trimming control and fix near-charger mowing enable control.\nRemove unsupported camera and docking resume controls.",
8
34
  "de": "Erweiterte Diagnosewerte, gruppierte State-Struktur, Verbrauchsmaterial-Resets, Mäher-Aktionsbefehle und schreibbare Mähsteuerungen hinzugefügt.\nVollflächen-Kantenschnitt-Steuerung hinzugefügt und Aktivierung des Mähens nahe der Ladestation korrigiert.\nNicht unterstützte Kamera- und Docking-Fortsetzen-Steuerungen entfernt.",
@@ -29,19 +55,6 @@
29
55
  "uk": "Додано керування обрізанням країв для повного косіння карти.\nВилучено непідтримувані елементи керування камерою та продовженням повернення до бази.\nВиправлено вмикання косіння біля зарядної станції через налаштування shadow косарки.",
30
56
  "zh-cn": "添加全地图割草的边缘修剪控制。\n移除不支持的摄像头和继续回充控制。\n修正充电站附近割草启用控制,改为使用割草机 shadow 设置。"
31
57
  },
32
- "0.1.0-beta.1": {
33
- "en": "Add expanded diagnostics for model names, region fallback, errors, RTK, map, firmware, OTA, network, and GPS/location data.\nCorrect consumable maintenance mapping to blades, cameras, and charging port.\nRefactor the state layout into grouped metrics, diagnostics, consumables, zones, raw shadows, and controls.",
34
- "de": "Erweiterte Diagnosewerte für Modellnamen, Region-Fallback, Fehler, RTK, Karte, Firmware, OTA, Netzwerk und GPS/Standort hinzugefügt.\nWartungszuordnung für Klingen, Kameras und Ladeport korrigiert.\nState-Struktur in gruppierte Metriken, Diagnosewerte, Verbrauchsmaterial, Zonen, Rohdaten-Shadows und Steuerungen umgebaut.",
35
- "ru": "Добавлена расширенная диагностика для моделей, резервного региона, ошибок, RTK, карты, прошивки, OTA, сети и GPS/местоположения.\nИсправлено сопоставление обслуживания расходников для лезвий, камер и зарядного порта.\nСтруктура состояний переработана в группы метрик, диагностики, расходников, зон, raw shadows и элементов управления.",
36
- "pt": "Adicionados diagnósticos expandidos para modelos, região de fallback, erros, RTK, mapa, firmware, OTA, rede e GPS/localização.\nCorrigido o mapeamento de manutenção de consumíveis para lâminas, câmeras e porta de carregamento.\nA estrutura de estados foi reorganizada em métricas, diagnósticos, consumíveis, zonas, sombras brutas e controles agrupados.",
37
- "nl": "Uitgebreide diagnostiek toegevoegd voor modelnamen, regiofallback, fouten, RTK, kaart, firmware, OTA, netwerk en GPS/locatie.\nOnderhoudstoewijzing voor messen, camera's en laadpoort gecorrigeerd.\nDe statusstructuur is herwerkt naar gegroepeerde metrics, diagnostiek, verbruiksdelen, zones, raw shadows en bediening.",
38
- "fr": "Ajout de diagnostics étendus pour les modèles, la région de secours, les erreurs, RTK, la carte, le firmware, OTA, le réseau et la position GPS.\nCorrection du mappage de maintenance des consommables pour les lames, les caméras et le port de charge.\nLa structure des états a été réorganisée en métriques, diagnostics, consommables, zones, shadows bruts et contrôles groupés.",
39
- "it": "Aggiunta diagnostica estesa per modelli, regione di fallback, errori, RTK, mappa, firmware, OTA, rete e posizione GPS.\nCorretta la mappatura della manutenzione dei consumabili per lame, telecamere e porta di ricarica.\nLa struttura degli stati è stata riorganizzata in metriche, diagnostica, consumabili, zone, shadow grezzi e controlli raggruppati.",
40
- "es": "Se añadieron diagnósticos ampliados para modelos, región alternativa, errores, RTK, mapa, firmware, OTA, red y GPS/ubicación.\nSe corrigió el mapeo de mantenimiento de consumibles para cuchillas, cámaras y puerto de carga.\nLa estructura de estados se reorganizó en métricas, diagnósticos, consumibles, zonas, shadows sin procesar y controles agrupados.",
41
- "pl": "Dodano rozszerzoną diagnostykę dla nazw modeli, regionu zapasowego, błędów, RTK, mapy, firmware, OTA, sieci oraz GPS/lokalizacji.\nPoprawiono mapowanie konserwacji materiałów eksploatacyjnych dla ostrzy, kamer i portu ładowania.\nStruktura stanów została przebudowana na pogrupowane metryki, diagnostykę, materiały eksploatacyjne, strefy, surowe shadows i sterowanie.",
42
- "uk": "Додано розширену діагностику для моделей, резервного регіону, помилок, RTK, карти, прошивки, OTA, мережі та GPS/розташування.\nВиправлено зіставлення обслуговування витратних матеріалів для лез, камер і зарядного порту.\nСтруктуру станів перероблено на згруповані метрики, діагностику, витратні матеріали, зони, raw shadows і керування.",
43
- "zh-cn": "添加扩展诊断信息,包括型号名称、区域回退、错误、RTK、地图、固件、OTA、网络和 GPS/位置数据。\n修正刀片、摄像头和充电端口的耗材维护映射。\n将状态结构重构为分组的指标、诊断、耗材、区域、原始 shadow 和控制项。"
44
- },
45
58
  "0.1.0-beta.0": {
46
59
  "en": "Add consumable reset buttons for station, cameras, and blades.\nAdd mower action commands: find robot, grass dump, disk maintenance mode, edge mowing, near-charger mowing, and point mowing.\nAdd task control commands: pause/continue mowing, pause/continue return-to-dock, and end mowing.\nAdd RTK antenna moved warning cancel command.\nAdd status and control states for mowing near the charging pile, including its mowing parameters.\nAdd camera switch status and control.\nAdd RTK antenna moved warning status.",
47
60
  "de": "Hinzufügen von Verbrauchs-Reset-Tasten für Station, Kameras und Klingen.\nFügen Sie Mäher-Action-Befehle hinzu: Finden Sie Roboter, Gras-Dump, Festplatten-Wartungsmodus, Rand Mähen, Nah-Ladegerät Mähen und Punkt Mähen.\nBefehle zur Task-Steuerung hinzufügen: Pause/Kontinue-Mähen, Pause/Fortsetzen-Rückkehr-zu-Dock und Ende-Mähen.\nFügen Sie RTK-Antenne bewegte Warnung Löschbefehl.\nFügen Sie Status- und Steuerzustände zum Mähen in der Nähe des Ladestapels hinzu, einschließlich seiner Mähparameter.\nFügen Sie Kameraschalter Status und Steuerung hinzu.\nFügen Sie RTK-Antenne bewegten Warnstatus hinzu.",
@@ -80,45 +93,6 @@
80
93
  "pl": "Dodaj kanały materiałów eksploatacyjnych i wartości do definicji adaptera.",
81
94
  "uk": "Додайте канали расходных материалов и значения в определение адаптера.",
82
95
  "zh-cn": "将消耗品通道和值添加到适配器定义中。"
83
- },
84
- "0.0.7": {
85
- "en": "Add Dependabot automerge configuration and update repository metadata.",
86
- "de": "Dependabot-Automerge-Konfiguration hinzugefügt und Repository-Metadaten aktualisiert.",
87
- "ru": "Добавлена конфигурация автоматического слияния Dependabot и обновлены метаданные репозитория.",
88
- "pt": "Adicionada configuração de automerge do Dependabot e atualizados os metadados do repositório.",
89
- "nl": "Dependabot-automergeconfiguratie toegevoegd en repositorymetadata bijgewerkt.",
90
- "fr": "Ajout de la configuration d'automerge Dependabot et mise à jour des métadonnées du dépôt.",
91
- "it": "Aggiunta la configurazione di automerge di Dependabot e aggiornati i metadati del repository.",
92
- "es": "Se añadió la configuración de automerge de Dependabot y se actualizaron los metadatos del repositorio.",
93
- "pl": "Dodano konfigurację automatycznego scalania Dependabot i zaktualizowano metadane repozytorium.",
94
- "uk": "Додано конфігурацію автоматичного злиття Dependabot і оновлено метадані репозиторію.",
95
- "zh-cn": "添加 Dependabot 自动合并配置并更新仓库元数据。"
96
- },
97
- "0.0.6": {
98
- "en": "Fix repository checker issues and move admin config translations to i18n files.",
99
- "de": "Probleme der Repository-Prüfung behoben und Admin-Konfigurationsübersetzungen in i18n-Dateien verschoben.",
100
- "ru": "Исправлены проблемы проверки репозитория, а переводы конфигурации администратора перенесены в файлы i18n.",
101
- "pt": "Corrigidos problemas do verificador de repositório e movidas as traduções da configuração de administração para arquivos i18n.",
102
- "nl": "Repositorycontroleproblemen opgelost en vertalingen van de adminconfiguratie verplaatst naar i18n-bestanden.",
103
- "fr": "Correction des problèmes du vérificateur de dépôt et déplacement des traductions de la configuration admin vers des fichiers i18n.",
104
- "it": "Risolti i problemi del controllo repository e spostate le traduzioni della configurazione admin nei file i18n.",
105
- "es": "Se corrigieron problemas del verificador del repositorio y se movieron las traducciones de la configuración de administración a archivos i18n.",
106
- "pl": "Naprawiono problemy wykryte przez kontroler repozytorium i przeniesiono tłumaczenia konfiguracji administratora do plików i18n.",
107
- "uk": "Виправлено проблеми перевірки репозиторію та перенесено переклади конфігурації адміністратора до файлів i18n.",
108
- "zh-cn": "修复仓库检查器问题,并将管理配置翻译移至 i18n 文件。"
109
- },
110
- "0.0.5": {
111
- "en": "Prepare adapter metadata for ioBroker checks.",
112
- "de": "Adapter-Metadaten für ioBroker-Prüfungen vorbereitet.",
113
- "ru": "Подготовлены метаданные адаптера для проверок ioBroker.",
114
- "pt": "Metadados do adaptador preparados para as verificações do ioBroker.",
115
- "nl": "Adaptermetadata voorbereid voor ioBroker-controles.",
116
- "fr": "Métadonnées de l'adaptateur préparées pour les vérifications ioBroker.",
117
- "it": "Metadati dell'adattatore preparati per i controlli ioBroker.",
118
- "es": "Metadatos del adaptador preparados para las comprobaciones de ioBroker.",
119
- "pl": "Przygotowano metadane adaptera do kontroli ioBroker.",
120
- "uk": "Підготовлено метадані адаптера для перевірок ioBroker.",
121
- "zh-cn": "为 ioBroker 检查准备适配器元数据。"
122
96
  }
123
97
  },
124
98
  "titleLang": {
@@ -156,7 +130,7 @@
156
130
  },
157
131
  "icon": "anthbot-genie.png",
158
132
  "extIcon": "https://raw.githubusercontent.com/reloxx13/ioBroker.anthbot-genie/main/admin/anthbot-genie.png",
159
- "readme": "https://github.com/reloxx13/ioBroker.anthbot-genie/blob/master/README.md",
133
+ "readme": "https://github.com/reloxx13/ioBroker.anthbot-genie/blob/main/README.md",
160
134
  "keywords": [
161
135
  "anthbot",
162
136
  "genie",
package/lib/anthbot.js CHANGED
@@ -840,6 +840,16 @@ function compactZonePayload(zones) {
840
840
  });
841
841
  }
842
842
 
843
+ function consumableLifetimes(data) {
844
+ const maintenance = data?.robot_maintenance || {};
845
+
846
+ return {
847
+ blades: typeof maintenance.rc_pecent === "number" ? maintenance.rc_pecent : null,
848
+ cameras: typeof maintenance.cl_pecent === "number" ? maintenance.cl_pecent : null,
849
+ chargingPort: typeof maintenance.ccp_pecent === "number" ? maintenance.ccp_pecent : null,
850
+ };
851
+ }
852
+
843
853
  function parseCommandSelection(value) {
844
854
  if (Array.isArray(value)) {
845
855
  return value;
@@ -875,6 +885,7 @@ module.exports = {
875
885
  autoZones,
876
886
  compactZonePayload,
877
887
  coerceEnabledValue,
888
+ consumableLifetimes,
878
889
  errorDescription,
879
890
  generalMowerStatus,
880
891
  isLikelyAuthenticationError,
package/main.js CHANGED
@@ -12,6 +12,7 @@ const {
12
12
  autoZones,
13
13
  compactZonePayload,
14
14
  coerceEnabledValue,
15
+ consumableLifetimes,
15
16
  errorDescription,
16
17
  generalMowerStatus,
17
18
  isLikelyAuthenticationError,
@@ -83,11 +84,11 @@ const DEVICE_STATE_DEFINITIONS = {
83
84
  "info.charging": { type: "boolean", role: "indicator.working", read: true, write: false, name: t("Charging", "Lädt") },
84
85
  "info.lastServiceCommand": { type: "string", role: "text", read: true, write: false, name: t("Last service command", "Letzter Servicebefehl") },
85
86
  "info.lastPoll": { type: "string", role: "date", read: true, write: false, name: t("Last poll", "Letzte Abfrage") },
86
- "consumable.chargingPort.life": { type: "number", role: "value.usage.chargingPort", unit: "%", read: true, write: false, name: t("Charging port lifetime", "Ladeport-Lebensdauer") },
87
+ "consumable.chargingPort.life": { type: "number", role: "value", unit: "%", read: true, write: false, name: t("Charging port lifetime", "Ladeport-Lebensdauer") },
87
88
  "consumable.chargingPort.reset": { type: "boolean", role: "button", read: true, write: true, name: t("Reset charging port lifetime", "Ladeport-Lebensdauer zurücksetzen"), def: false },
88
- "consumable.cameras.life": { type: "number", role: "value.usage.cameras", unit: "%", read: true, write: false, name: t("Cameras lifetime", "Kameras Lebensdauer") },
89
+ "consumable.cameras.life": { type: "number", role: "value", unit: "%", read: true, write: false, name: t("Cameras lifetime", "Kameras Lebensdauer") },
89
90
  "consumable.cameras.reset": { type: "boolean", role: "button", read: true, write: true, name: t("Reset cameras lifetime", "Kameras-Lebensdauer zurücksetzen"), def: false },
90
- "consumable.blades.life": { type: "number", role: "value.usage.blades", unit: "%", read: true, write: false, name: t("Blades lifetime", "Klingen Lebensdauer") },
91
+ "consumable.blades.life": { type: "number", role: "value", unit: "%", read: true, write: false, name: t("Blades lifetime", "Klingen Lebensdauer") },
91
92
  "consumable.blades.reset": { type: "boolean", role: "button", read: true, write: true, name: t("Reset blades lifetime", "Klingen-Lebensdauer zurücksetzen"), def: false },
92
93
  "metrics.batteryLevel": { type: "number", role: "value.battery", unit: "%", read: true, write: false, name: t("Battery level", "Akkustand") },
93
94
  "metrics.status.mower": { type: "string", role: "value", read: true, write: false, name: t("Mower status", "Mäherstatus") },
@@ -118,8 +119,8 @@ const DEVICE_STATE_DEFINITIONS = {
118
119
  "diagnostics.rtk.antennaMoved": { type: "boolean", role: "indicator", read: true, write: false, name: t("RTK antenna moved", "RTK-Antenne bewegt") },
119
120
  "diagnostics.rtk.baseFirmware": { type: "string", role: "text", read: true, write: false, name: t("RTK base firmware", "RTK-Basis-Firmware") },
120
121
  "diagnostics.cameraError": { type: "boolean", role: "indicator.maintenance", read: true, write: false, name: t("Camera error", "Kamerafehler") },
121
- "diagnostics.network.wifiConnected": { type: "boolean", role: "indicator.connected", read: true, write: false, name: t("WiFi connected", "WLAN verbunden") },
122
- "diagnostics.network.cellularConnected": { type: "boolean", role: "indicator.connected", read: true, write: false, name: t("Cellular connected", "Mobilfunk verbunden") },
122
+ "diagnostics.network.wifiConnected": { type: "boolean", role: "indicator.reachable", read: true, write: false, name: t("WiFi connected", "WLAN verbunden") },
123
+ "diagnostics.network.cellularConnected": { type: "boolean", role: "indicator.reachable", read: true, write: false, name: t("Cellular connected", "Mobilfunk verbunden") },
123
124
  "diagnostics.network.cellularHeartbeat": { type: "boolean", role: "indicator", read: true, write: false, name: t("Cellular heartbeat", "Mobilfunk-Heartbeat") },
124
125
  "diagnostics.network.bluetoothActive": { type: "boolean", role: "indicator", read: true, write: false, name: t("Bluetooth active", "Bluetooth aktiv") },
125
126
  "diagnostics.network.wifiSsid": { type: "string", role: "text", read: true, write: false, name: t("WiFi SSID", "WLAN-SSID") },
@@ -247,9 +248,11 @@ class AnthbotGenieAdapter extends utils.Adapter {
247
248
  this.deviceContexts = new Map();
248
249
  this.pollTimer = null;
249
250
  this.refreshInFlight = null;
251
+ this.unloaded = false;
250
252
  }
251
253
 
252
254
  async onReady() {
255
+ this.unloaded = false;
253
256
  this.http = axios.create({
254
257
  timeout: 15000,
255
258
  validateStatus: () => true,
@@ -288,8 +291,9 @@ class AnthbotGenieAdapter extends utils.Adapter {
288
291
 
289
292
  onUnload(callback) {
290
293
  try {
294
+ this.unloaded = true;
291
295
  if (this.pollTimer) {
292
- clearTimeout(this.pollTimer);
296
+ this.clearTimeout(this.pollTimer);
293
297
  this.pollTimer = null;
294
298
  }
295
299
  callback();
@@ -299,16 +303,21 @@ class AnthbotGenieAdapter extends utils.Adapter {
299
303
  }
300
304
 
301
305
  schedulePoll() {
306
+ if (this.unloaded) {
307
+ return;
308
+ }
302
309
  if (this.pollTimer) {
303
- clearTimeout(this.pollTimer);
310
+ this.clearTimeout(this.pollTimer);
304
311
  }
305
312
  const intervalSeconds = Math.max(10, Number(this.config.pollInterval) || 30);
306
- this.pollTimer = setTimeout(async () => {
313
+ this.pollTimer = this.setTimeout(async () => {
307
314
  this.pollTimer = null;
308
315
  try {
309
316
  await this.refreshAll();
310
317
  } finally {
311
- this.schedulePoll();
318
+ if (!this.unloaded) {
319
+ this.schedulePoll();
320
+ }
312
321
  }
313
322
  }, intervalSeconds * 1000);
314
323
  }
@@ -547,6 +556,7 @@ class AnthbotGenieAdapter extends utils.Adapter {
547
556
  const rtkAntennaMoved = coerceEnabledValue(data?.rtk_move_sta?.value);
548
557
  const serviceCommand = typeof data?._service_reported?.cmd === "string" ? data._service_reported.cmd : "";
549
558
  const pose = data?.pose && typeof data.pose === "object" ? data.pose : {};
559
+ const consumables = consumableLifetimes(data);
550
560
 
551
561
  const updates = {
552
562
  "info.alias": context.device.alias,
@@ -559,9 +569,9 @@ class AnthbotGenieAdapter extends utils.Adapter {
559
569
  "info.lastPoll": new Date().toISOString(),
560
570
 
561
571
  // 2026-04-26: The cloud API misspells "percent" as "pecent" in the robot_maintenance object, so we need to use the wrong spelling here to get the data until it's fixed upstream.
562
- "consumable.chargingPort.life": typeof data.robot_maintenance?.rc_pecent === "number" ? data.robot_maintenance.rc_pecent : null,
563
- "consumable.cameras.life": typeof data.robot_maintenance?.cl_pecent === "number" ? data.robot_maintenance.cl_pecent : null,
564
- "consumable.blades.life": typeof data.robot_maintenance?.ccp_pecent === "number" ? data.robot_maintenance.ccp_pecent : null,
572
+ "consumable.chargingPort.life": consumables.chargingPort,
573
+ "consumable.cameras.life": consumables.cameras,
574
+ "consumable.blades.life": consumables.blades,
565
575
 
566
576
  "metrics.batteryLevel": typeof data.elec === "number" ? data.elec : null,
567
577
  "metrics.status.mower": generalMowerStatus(data),
@@ -1220,7 +1230,7 @@ class AnthbotGenieAdapter extends utils.Adapter {
1220
1230
  }
1221
1231
 
1222
1232
  delay(ms) {
1223
- return new Promise(resolve => setTimeout(resolve, ms));
1233
+ return new Promise(resolve => this.setTimeout(resolve, ms));
1224
1234
  }
1225
1235
  }
1226
1236
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.anthbot-genie",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Unofficial ioBroker adapter for Anthbot Genie mowers",
5
5
  "author": "reloxx13",
6
6
  "license": "MIT",
@@ -30,9 +30,11 @@
30
30
  "README.md"
31
31
  ],
32
32
  "scripts": {
33
- "check": "node --check main.js && node --check lib/anthbot.js",
34
- "test:package": "npm run check",
35
- "test:integration": "npm run check",
33
+ "check": "node --check main.js && node --check lib/anthbot.js && node --check test/package/testPackageFiles.js && node --check test/integration/testStartup.js && node --check test/unit/anthbot.test.js",
34
+ "test:js": "mocha \"test/unit/**/*.test.js\"",
35
+ "test:package": "mocha test/package --exit",
36
+ "test:integration": "mocha test/integration --exit",
37
+ "test": "npm run check && npm run test:js && npm run test:package",
36
38
  "check:repo": "npx @iobroker/repochecker https://github.com/reloxx13/ioBroker.anthbot-genie --noinfo",
37
39
  "release": "release-script"
38
40
  },