iobroker.al-ko 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
@@ -53,28 +53,12 @@ Do **not** contact AL-KO customer service regarding this project.
53
53
 
54
54
  ## Changelog
55
55
 
56
- ### 0.3.2 (2026-03-12)
56
+ ### 0.3.3 (2026-03-13)
57
57
 
58
- - Improved WebSocket reconnect handling after token refresh
59
- - Prevented reconnect loops on intentional WebSocket closes
60
- - Improved API error logging for push requests
61
- - Added WebSocket close code and reason logging
62
-
63
- ### 0.3.1 (2026-03-09)
64
-
65
- - Documentation improvements
66
- - Corrected LICENSE information
67
- - Updated development dependencies
68
- - Minor CI / workflow cleanup
69
- - No functional changes
70
-
71
- ### 0.3.0 (2026-03-09)
72
-
73
- - Major maintenance release
74
- - Updated ESLint 9, Prettier 3 and TypeScript tooling
58
+ - Improved WebSocket reconnect handling
59
+ - Fixed processing of AL-KO WebSocket reportedState messages
60
+ - Updated Dependabot and workflow configuration
75
61
  - Updated development dependencies
76
- - Improved CI pipeline and adapter structure
77
- - No functional changes
78
62
 
79
63
  ➡ Full changelog here:
80
64
  [CHANGELOG.md](./CHANGELOG.md)
package/docs/de/README.md CHANGED
@@ -48,6 +48,14 @@ AL-KO bietet **keinen offiziellen Support** hierfür.
48
48
 
49
49
  ## Änderungen (Auszug)
50
50
 
51
+ ### 0.3.3 (2026-03-13)
52
+
53
+ - WebSocket-Verarbeitung verbessert
54
+ - Verarbeitung der AL-KO `reportedState` WebSocket-Nachrichten korrigiert
55
+ - Stabileres Wiederverbinden der WebSocket-Verbindung
56
+ - GitHub-Workflows aktualisiert (Dependabot / Automerge)
57
+ - Entwicklungsabhängigkeiten aktualisiert
58
+
51
59
  ### 0.3.2 (2026-03-12)
52
60
 
53
61
  - WebSocket-Reconnect nach Token-Aktualisierung verbessert
package/docs/en/README.md CHANGED
@@ -48,19 +48,12 @@ It is a **community-developed project**.
48
48
 
49
49
  ## Changes (Summary)
50
50
 
51
- ### 0.3.2 (2026-03-12)
51
+ ### 0.3.3 (2026-03-13)
52
52
 
53
- - Improved WebSocket reconnect handling after token refresh
54
- - Prevented reconnect loops on intentional WebSocket closes
55
- - Improved API error logging for push requests
56
- - Added WebSocket close code and reason logging
57
-
58
- ### 0.3.1 (2026-03-09)
59
-
60
- - Documentation improvements
61
- - Corrected LICENSE information
53
+ - Improved WebSocket reconnect handling
54
+ - Fixed processing of AL-KO WebSocket reportedState messages
55
+ - Updated Dependabot and workflow configuration
62
56
  - Updated development dependencies
63
- - No functional changes
64
57
 
65
58
  See full changelog here:
66
59
  ➡ [CHANGELOG.md](../../CHANGELOG.md)
package/io-package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "al-ko",
4
- "version": "0.3.2",
4
+ "version": "0.3.3",
5
5
  "tier": 3,
6
6
  "titleLang": {
7
7
  "en": "AL-KO",
@@ -40,6 +40,10 @@
40
40
  "de": "docs/de/README.md"
41
41
  },
42
42
  "news": {
43
+ "0.3.3": {
44
+ "en": "Improved WebSocket handling and message processing, updated repository workflows, and updated development dependencies.",
45
+ "de": "WebSocket-Handling und Nachrichtenverarbeitung verbessert, Repository-Workflows aktualisiert und Entwicklungsabhängigkeiten aktualisiert."
46
+ },
43
47
  "0.3.2": {
44
48
  "en": "Improved WebSocket reconnect handling, prevented reconnect loops on intentional closes, and improved API error logging for push requests.",
45
49
  "de": "WebSocket-Reconnect-Verhalten verbessert, Reconnect-Schleifen bei absichtlich geschlossenen Verbindungen verhindert und API-Fehlerlogging für Push-Requests verbessert."
@@ -51,18 +55,6 @@
51
55
  "0.3.0": {
52
56
  "en": "Major maintenance release. Updated ESLint 9, Prettier 3, TypeScript tooling and development dependencies. Improved adapter structure and CI pipeline. No functional changes.",
53
57
  "de": "Größeres Wartungsrelease. Aktualisierung von ESLint 9, Prettier 3, TypeScript-Tooling und Entwicklungsabhängigkeiten. Verbesserte Adapterstruktur und CI-Pipeline. Keine funktionalen Änderungen."
54
- },
55
- "0.2.15": {
56
- "en": "Admin config cleanup for adapter-check: removed $schema, corrected structure, added missing size attributes.",
57
- "de": "Admin-Konfiguration für adapter-check bereinigt: $schema entfernt, Struktur korrigiert, fehlende size-Attribute ergänzt."
58
- },
59
- "0.2.14": {
60
- "en": "Updated development tooling: release-script v5, plugins v4, ESLint 9, TypeScript 5.9, Prettier 3.",
61
- "de": "Entwicklungswerkzeuge aktualisiert: release-script v5, Plugins v4, ESLint 9, TypeScript 5.9, Prettier 3."
62
- },
63
- "0.2.13": {
64
- "en": "Fixed JSON syntax error in io-package.json. No functional changes.",
65
- "de": "JSON-Syntaxfehler in io-package.json behoben. Keine funktionalen Änderungen."
66
58
  }
67
59
  },
68
60
  "keywords": ["al-ko", "Robolinho", "mower", "garden", "smart-garden"],
package/main.js CHANGED
@@ -413,22 +413,41 @@ class AlKoAdapter extends utils.Adapter {
413
413
  if (this.config.wsDebug) {
414
414
  this.log.debug(`WebSocket message (${deviceId}): ${msg}`);
415
415
  }
416
+
416
417
  try {
417
418
  const data = JSON.parse(msg.toString());
418
- if (data && data.state) {
419
- const newState = data.state.reported || data.state;
420
419
 
421
- this.deviceStates[deviceId] = this.deepMerge(
422
- this.deviceStates[deviceId] || {},
423
- newState,
424
- );
420
+ let newState = null;
421
+
422
+ if (data?.reportedState?.state?.reported) {
423
+ newState = data.reportedState.state.reported;
424
+ } else if (
425
+ data?.reportedState &&
426
+ typeof data.reportedState === "object" &&
427
+ !data.reportedState.state &&
428
+ !data.reportedState.previous &&
429
+ !data.reportedState.current &&
430
+ !data.reportedState.metadata
431
+ ) {
432
+ newState = data.reportedState;
433
+ } else if (data?.state?.reported) {
434
+ newState = data.state.reported;
435
+ }
425
436
 
426
- await this.createStatesRecursive(
427
- `${this.namespace}.${deviceId}.state`,
428
- this.deviceStates[deviceId],
429
- "",
430
- );
437
+ if (!newState || typeof newState !== "object") {
438
+ return;
431
439
  }
440
+
441
+ this.deviceStates[deviceId] = this.deepMerge(
442
+ this.deviceStates[deviceId] || {},
443
+ newState,
444
+ );
445
+
446
+ await this.createStatesRecursive(
447
+ `${this.namespace}.${deviceId}.state`,
448
+ this.deviceStates[deviceId],
449
+ "",
450
+ );
432
451
  } catch (e) {
433
452
  this.log.error(
434
453
  `Error processing WebSocket message for device ${deviceId}: ${e.message}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.al-ko",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Adapter for communication with AL-KO smart garden devices (Robolinho, mowing windows, operationState, etc.)",
5
5
  "author": {
6
6
  "name": "Hubert Zechner",
@@ -64,9 +64,9 @@
64
64
  "@iobroker/eslint-config": "^2.2.0",
65
65
  "@iobroker/testing": "^5.2.2",
66
66
  "@tsconfig/node20": "^20.1.8",
67
- "@types/node": "^25.1.0",
68
- "@typescript-eslint/eslint-plugin": "^8.54.0",
69
- "@typescript-eslint/parser": "^8.54.0",
67
+ "@types/node": "^25.5.0",
68
+ "@typescript-eslint/eslint-plugin": "^8.57.0",
69
+ "@typescript-eslint/parser": "^8.57.0",
70
70
  "prettier": "^3.8.1",
71
71
  "proxyquire": "^2.1.3"
72
72
  },