Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.10.15 #2344

Merged
merged 5 commits into from
Jan 2, 2025
Merged

1.10.15 #2344

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Device_support_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 14 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
24 changes: 21 additions & 3 deletions lib/exposes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.zigbee",
"version": "1.10.14",
"version": "1.10.15",
"author": {
"name": "Kirov Ilya",
"email": "[email protected]"
Expand Down
Loading