From 39b687833f3c57f22c3c9efa5959521d7fd26296 Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Tue, 31 Dec 2024 18:12:59 +0100 Subject: [PATCH 1/4] Update Device_support_request.yaml --- .github/ISSUE_TEMPLATE/Device_support_request.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/Device_support_request.yaml b/.github/ISSUE_TEMPLATE/Device_support_request.yaml index f1cdb699..06ad7644 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.14' validations: required: true - type: input From 60899b5353e17809c734add141f95a7f0c7fbfdd Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Tue, 31 Dec 2024 18:30:30 +0100 Subject: [PATCH 2/4] Push version Version 1.10.15 for bugfixes while being locked to Zigbee-herdsman-controllers 20.x.x --- .../ISSUE_TEMPLATE/Device_support_request.yaml | 2 +- io-package.json | 15 ++++++++++++++- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Device_support_request.yaml b/.github/ISSUE_TEMPLATE/Device_support_request.yaml index 06ad7644..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.14' + placeholder: '1.10.15' validations: required: true - type: input diff --git a/io-package.json b/io-package.json index 5022997d..89e2bdea 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", "de": "Herdsman 2.1.9, Converters 20.58.0", diff --git a/package-lock.json b/package-lock.json index 568e0e7b..cfa6c34e 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 d8011d52..b4ae8184 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" From fe30441ec450101b99aebedb797cfbf8135bc70b Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Thu, 2 Jan 2025 23:01:11 +0100 Subject: [PATCH 3/4] Update exposes.js Fix Philips 'hold_release' issue. --- lib/exposes.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/exposes.js b/lib/exposes.js index 3b2b150f..9d86770d 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,10 +699,25 @@ 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 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', + name: actionName, + icon: undefined, + role: 'button', + write: false, + read: true, + type: 'boolean', + getter: payload => payload.action === getterKey ? true : undefined, + isEvent: true, }; } else { - state = { + state = { id: actionName.replace(/\*/g, ''), prop: 'action', name: actionName, @@ -710,8 +728,8 @@ function createFromExposes(model, def) { type: 'boolean', getter: payload => payload.action === actionName ? true : undefined, isEvent: true, - }; - } + }; + }; pushToStates(state, expose.access); } state = null; From 070b1ce32b1153ac329579932c0693236d0f4901 Mon Sep 17 00:00:00 2001 From: asgothian <45667167+asgothian@users.noreply.github.com> Date: Thu, 2 Jan 2025 23:35:06 +0100 Subject: [PATCH 4/4] Update exposes.js linter fix --- lib/exposes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/exposes.js b/lib/exposes.js index 9d86770d..72dd6e6d 100644 --- a/lib/exposes.js +++ b/lib/exposes.js @@ -702,9 +702,9 @@ function createFromExposes(model, def) { getter: payload => payload.action === actionName ? true : (payload.action === releaseActionName || payload.action === releaseActionName2 ? false : undefined), }; } else if (hasPress && hasPressRelease && actionName.includes('press')) { - let getterKey = actionName.concat('_release'); + let getterKey = actionName.concat('_release'); if (expose.values.indexOf(getterKey) < 0) getterKey = actionName; - state = { + state = { id: actionName.replace(/\*/g, ''), prop: 'action', name: actionName, @@ -728,7 +728,7 @@ function createFromExposes(model, def) { type: 'boolean', getter: payload => payload.action === actionName ? true : undefined, isEvent: true, - }; + }; }; pushToStates(state, expose.access); }