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. */