diff --git a/.github/ISSUE_TEMPLATE/Device_support_request.yaml b/.github/ISSUE_TEMPLATE/Device_support_request.yaml index f1cdb699..dfd71735 100644 --- a/.github/ISSUE_TEMPLATE/Device_support_request.yaml +++ b/.github/ISSUE_TEMPLATE/Device_support_request.yaml @@ -13,7 +13,7 @@ body: id: zigbee_version attributes: label: Tested with adapter version - placeholder: '1.10.13' + placeholder: '1.10.15' validations: required: true - type: input diff --git a/io-package.json b/io-package.json index 0fd45509..3ddc6cc1 100644 --- a/io-package.json +++ b/io-package.json @@ -1,8 +1,21 @@ { "common": { "name": "zigbee", - "version": "1.10.14", + "version": "1.10.15", "news": { + "1.10.15": { + "en": "Work in progress", + "de": "Work in progress", + "ru": "Work in progress", + "pt": "Work in progress", + "nl": "Work in progress", + "fr": "Work in progress", + "it": "Work in progress", + "es": "Work in progress", + "pl": "Work in progress", + "uk": "Work in progress", + "zh-cn": "Work in progress" + }, "1.10.14": { "en": "Herdsman 2.1.9, Converters 20.58.0\nFix: Aqara T1M (CL-L02D) \ndeleteDeviceStates change to deleteObj", "de": "Herdsman 2.1.9, Konverter 20.58.0\nFix: Aqara T1M (CL-L02D)\nlöschen DeviceState Änderung zum Löschen Ob", diff --git a/lib/exposes.js b/lib/exposes.js index 3b2b150f..72dd6e6d 100644 --- a/lib/exposes.js +++ b/lib/exposes.js @@ -681,12 +681,15 @@ function createFromExposes(model, def) { if (!Array.isArray(expose.values)) break; const hasHold = expose.values.find((actionName) => actionName.includes('hold')); const hasRelease = expose.values.find((actionName) => actionName.includes('release')); + const hasPress = expose.values.find((actionName) => actionName.includes('press')); + const hasPressRelease = expose.values.find((actionName) => actionName.includes('press_release')); for (const actionName of expose.values) { // is release state ? - skip if (hasHold && hasRelease && actionName.includes('release')) continue; // is hold state ? if (hasHold && hasRelease && actionName.includes('hold')) { const releaseActionName = actionName.replace('hold', 'release'); + const releaseActionName2 = actionName.concat('_release'); state = { id: actionName.replace(/\*/g, ''), prop: 'action', @@ -696,9 +699,11 @@ function createFromExposes(model, def) { write: false, read: true, type: 'boolean', - getter: payload => payload.action === actionName ? true : (payload.action === releaseActionName ? false : undefined), + getter: payload => payload.action === actionName ? true : (payload.action === releaseActionName || payload.action === releaseActionName2 ? false : undefined), }; - } else { + } else if (hasPress && hasPressRelease && actionName.includes('press')) { + let getterKey = actionName.concat('_release'); + if (expose.values.indexOf(getterKey) < 0) getterKey = actionName; state = { id: actionName.replace(/\*/g, ''), prop: 'action', @@ -708,10 +713,23 @@ function createFromExposes(model, def) { write: false, read: true, type: 'boolean', + getter: payload => payload.action === getterKey ? true : undefined, + isEvent: true, + }; + } else { + state = { + id: actionName.replace(/\*/g, ''), + prop: 'action', + name: actionName, + icon: undefined, + role: 'button', + write: false, + read: true, + type: 'boolean', getter: payload => payload.action === actionName ? true : undefined, isEvent: true, }; - } + }; pushToStates(state, expose.access); } state = null; diff --git a/package-lock.json b/package-lock.json index a4e3e006..e171291f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "iobroker.zigbee", - "version": "1.10.14", + "version": "1.10.15", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "iobroker.zigbee", - "version": "1.10.14", + "version": "1.10.15", "license": "MIT", "dependencies": { "@iobroker/adapter-core": "^3.2.2", diff --git a/package.json b/package.json index 7f4d1773..e20aacce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.zigbee", - "version": "1.10.14", + "version": "1.10.15", "author": { "name": "Kirov Ilya", "email": "kirovilya@gmail.com"