From dd47e3d9b3f2995d8cebeb1e6e77fb3c83c2a647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Pluta?= Date: Mon, 22 Dec 2025 00:27:49 +0100 Subject: [PATCH] Update availability transformation pattern --- src/adapters/z2m.ts | 3 ++- src/types/openhab.ts | 1 + tsconfig.json | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/adapters/z2m.ts b/src/adapters/z2m.ts index dfadc5f..ccd65c2 100644 --- a/src/adapters/z2m.ts +++ b/src/adapters/z2m.ts @@ -181,7 +181,8 @@ export class Z2MAdapter extends Adapter { configuration: { availabilityTopic: `${thingTopic}/availability`, payloadNotAvailable: "offline", - payloadAvailable: "online" + payloadAvailable: "online", + transformationPattern: ["JSONPATH($.state)"] }, properties: {}, channels: [...exposes, ...options] diff --git a/src/types/openhab.ts b/src/types/openhab.ts index db8b199..b8ad3af 100644 --- a/src/types/openhab.ts +++ b/src/types/openhab.ts @@ -19,6 +19,7 @@ export type ThingConfig = { availabilityTopic: string; payloadNotAvailable: string; payloadAvailable: string; + transformationPattern: string[]; }; export type Channel = { diff --git a/tsconfig.json b/tsconfig.json index a79c412..1b73672 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,7 @@ /* Language and Environment */ "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + "lib": ["es2019"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ // "jsx": "preserve", /* Specify what JSX code is generated. */ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */