diff --git a/README.md b/README.md index 7fcfdf3d..d17b45fa 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,14 @@ You can thank the authors by these links: ----------------------------------------------------------------------------------------------------- ## Changelog -### UNRELEASED +### ### 1.10.10 (2024-09-27) * (lebrinkma) fix linter errors +* (asgothian) disable map display for deactivated devices +* (asgothian) new option on map: disable physics interaction +* (asgothian) new zigbee-herdsman-converters 20.28.0 +* (asgothian) new zigbee-herdsman 2.1.1 +* (asgothian) Allow use of keyless converters (used for TuYa and compatible devices in zigbee-herdsman-converters +* (arteck) swap from request to axios ### 1.10.9 (2024-09-05) * (arteck) typo admin settings diff --git a/admin/admin.js b/admin/admin.js index a3e30449..8d772e27 100644 --- a/admin/admin.js +++ b/admin/admin.js @@ -29,6 +29,22 @@ let devices = [], shuffleInstance; const updateCardInterval = setInterval(updateCardTimer, 6000); +const networkOptions = { + autoResize: true, + height: '100%', + width: '100%', + nodes: { + shape: 'box' + }, + layout: { + improvedLayout: true, + }, + physics: { + enabled: true, + } +}; + + const savedSettings = [ 'port', 'panID', 'channel', 'disableLed', 'countDown', 'groups', 'extPanID', 'precfgkey', 'transmitPower', 'adapterType', 'debugHerdsman', 'disableBackup', 'disablePing', 'external', 'startWithInconsistent', 'warnOnDeviceAnnouncement', 'baudRate', 'flowCTRL' @@ -1099,13 +1115,13 @@ function showNetworkMap(devices, map) { const edges = []; if (map.lqis == undefined || map.lqis.length === 0) { // first init - $('#filterParent, #filterSibl, #filterPrvChild, #filterMesh').change(function () { + $('#filterParent, #filterSibl, #filterPrvChild, #filterMesh, #physicsOn').change(function () { updateMapFilter(); }); } const createNode = function (dev, mapEntry) { - if (dev.common && dev.common.type == 'group') return undefined; + if (dev.common && (dev.common.type == 'group' || dev.common.deactivated)) return undefined; const extInfo = (mapEntry && mapEntry.networkAddress) ? `\n (nwkAddr: 0x${mapEntry.networkAddress.toString(16)} | ${mapEntry.networkAddress})` : ''; const node = { id: dev._id, @@ -1296,19 +1312,8 @@ function showNetworkMap(devices, map) { nodes: nodesArray, edges: mapEdges }; - const options = { - autoResize: true, - height: '100%', - width: '100%', - nodes: { - shape: 'box' - }, - layout: { - improvedLayout: true, - } - }; - - network = new vis.Network(container, data, options); + + network = new vis.Network(container, data, networkOptions); const onMapSelect = function (event) { // workaround for https://github.com/almende/vis/issues/4112 @@ -1406,6 +1411,8 @@ function updateMapFilter() { const showSibl = $('#filterSibl').is(':checked'); const showPrvChild = $('#filterPrvChild').is(':checked'); const invisColor = $('#filterMesh').is(':checked') ? 0.2 : 0; + networkOptions.physics.enabled = $('#physicsOn').is(':checked'); + network.setOptions(networkOptions); mapEdges.forEach((edge) => { if (((edge.relationship === 0 || edge.relationship === 1) && showParent) || (edge.relationship === 2 && showSibl) diff --git a/admin/index_m.html b/admin/index_m.html index 5bbfffe2..8962f9aa 100644 --- a/admin/index_m.html +++ b/admin/index_m.html @@ -1270,6 +1270,12 @@

Map view config

Mesh +
+ +

Device map info

diff --git a/admin/tab_m.html b/admin/tab_m.html index f717e88f..3467f2cf 100644 --- a/admin/tab_m.html +++ b/admin/tab_m.html @@ -963,7 +963,13 @@

Map view config

Mesh
- +
+ +
+

Device map info

diff --git a/io-package.json b/io-package.json index 0bf8e1bd..ed921871 100644 --- a/io-package.json +++ b/io-package.json @@ -1,8 +1,21 @@ { "common": { "name": "zigbee", - "version": "1.10.9", + "version": "1.10.10", "news": { + "1.10.10": { + "en": "core update\ndependency update", + "de": "kern-update\naktualisierung der abhängigkeit", + "ru": "обновление\nобновление", + "pt": "atualização do núcleo\natualização de dependência", + "nl": "kernupdate\nafhankelijkheidsupdate", + "fr": "mise à jour de base\nmise à jour de la dépendance", + "it": "aggiornamento del core\naggiornamento della dipendenza", + "es": "actualización básica\nactualización de la dependencia", + "pl": "podstawowa aktualizacja\naktualizacja zależności", + "uk": "оновлення ядра\nоновлення залежності", + "zh-cn": "核心更新\n依赖性更新" + }, "1.10.9": { "en": "typo admin settings\neslint config", "de": "typo admin einstellungen\neslint config", diff --git a/main.js b/main.js index 254ffced..63212030 100644 --- a/main.js +++ b/main.js @@ -625,12 +625,18 @@ class Zigbee extends utils.Adapter { this.log.debug(`entity: ${deviceId} ${model} ${safeJsonStringify(entity)}`); const mappedModel = entity.mapped; - + if (!mappedModel) { this.log.debug(`No mapped model for ${model}`); return; } + if (!mappedModel.toZigbee) + { + this.log.error(`No toZigbee in mapped model for ${model}`); + return; + } + stateList.forEach(async changedState => { const stateDesc = changedState.stateDesc; const value = changedState.value; @@ -691,13 +697,35 @@ class Zigbee extends utils.Adapter { } return; } - const converter = mappedModel.toZigbee.find(c => c && (c.key.includes(stateDesc.prop) || c.key.includes(stateDesc.setattr) || c.key.includes(stateDesc.id))); - if (!converter) { - this.log.error(`No converter available for '${model}' with key '${stateDesc.id}' `); - this.sendError(`No converter available for '${model}' with key '${stateDesc.id}' `); - return; - } + let converter = undefined; + for (const c of mappedModel.toZigbee) { + + if (!c.hasOwnProperty('convertSet')) continue; + this.log.debug(`Type of toZigbee is '${typeof c}', Contains key ${(c.hasOwnProperty('key')?JSON.stringify(c.key):'false ')}`) + if (!c.hasOwnProperty('key') && c.hasOwnProperty('convertSet') && converter === undefined) + { + converter = c; + this.log.debug('setting converter to keyless converter') + continue; + } + if (c.key.includes(stateDesc.prop) || c.key.includes(stateDesc.setattr) || c.key.includes(stateDesc.id)) + { + this.log.debug(`${(converter===undefined?'Setting':'Overriding')}' converter to converter with key(s)'${JSON.stringify(c.key)}}`) + converter = c; + } + + } +/* + if (!mappedModel.toZigbee[0].hasOwnProperty('key') && mappedModel.toZigbee[0].hasOwnProperty('convertSet')) converter = mappedModel.toZigbee[0]; + converter = mappedModel.toZigbee.find(c => c && c.hasOwnProperty('key') && (c.key.includes(stateDesc.prop) || c.key.includes(stateDesc.setattr) || c.key.includes(stateDesc.id))); +*/ + if (converter === undefined) { + this.log.error(`No converter available for '${model}' with key '${stateDesc.id}' `); + this.sendError(`No converter available for '${model}' with key '${stateDesc.id}' `); + return; + } + const preparedValue = (stateDesc.setter) ? stateDesc.setter(value, options) : value; const preparedOptions = (stateDesc.setterOpt) ? stateDesc.setterOpt(value, options) : {}; diff --git a/package-lock.json b/package-lock.json index 51a7cfff..4220c0b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "iobroker.zigbee", - "version": "1.10.9", + "version": "1.10.10", "lockfileVersion": 3, "requires": true, "packages": { @@ -16,8 +16,8 @@ "tar": "^7.4.3", "typescript": "^5.6.2", "uri-js": "^4.4.1", - "zigbee-herdsman": "0.56.2", - "zigbee-herdsman-converters": "20.2.0" + "zigbee-herdsman": "2.1.1", + "zigbee-herdsman-converters": "20.28.0" }, "devDependencies": { "@alcalzone/release-script": "^3.8.0", diff --git a/package.json b/package.json index a96e0335..6f98bedb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.zigbee", - "version": "1.10.9", + "version": "1.10.10", "author": { "name": "Kirov Ilya", "email": "kirovilya@gmail.com" @@ -28,8 +28,8 @@ "ajv": "^8.17.1", "uri-js": "^4.4.1", "typescript": "^5.6.2", - "zigbee-herdsman": "0.56.2", - "zigbee-herdsman-converters": "20.2.0" + "zigbee-herdsman": "2.1.1", + "zigbee-herdsman-converters": "20.28.0" }, "description": "Zigbee devices", "devDependencies": {