diff --git a/package.json b/package.json index e3468a1cb455164ef20baf7dbe1498ccbcd410f6..f9d690e1b862a1e341199e693a364bcdf19cea94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "usp-js", - "version": "0.4.7", + "version": "0.4.8", "description": "Library for easy usp(TR-369) communication using mqtt or ws.", "main": "node/index.js", "browser": "web/index.js", diff --git a/src/commands/recipes/subscribe.ts b/src/commands/recipes/subscribe.ts index 96358387ddafe14ec79b69d4205095dc7c9fe970..346e3489ee419d5db6c1ffe7babb2536e1181521 100644 --- a/src/commands/recipes/subscribe.ts +++ b/src/commands/recipes/subscribe.ts @@ -14,12 +14,12 @@ const make: MakeFn = const newSubPath = await call("ADD", { path: subscriptionPath, value: { - Enable: true, + Enable: opts.enable ?? true, ID: id, NotifType: opts.notif, - NotifRetry: "retry" in opts ? opts.retry : true, + NotifRetry: opts.retry ?? true, ReferenceList: refList, - Persistent: false, + Persistent: opts.persist ?? false, }, }); diff --git a/src/types.ts b/src/types.ts index a1efb7a4e37367d6f7ae895666988aabb27b1f40..6bf2d6d6ea6bd3351ccadc55753321c721e0fb18 100644 --- a/src/types.ts +++ b/src/types.ts @@ -693,6 +693,8 @@ export interface SubscriptionOptions { notif: NotifType; retry?: boolean; reference: string | string[]; + persist?: boolean; + enable?: boolean; } export type SubscriptionCallback = (