diff --git a/README.md b/README.md index d17b45fa..d956de97 100644 --- a/README.md +++ b/README.md @@ -136,8 +136,12 @@ You can thank the authors by these links: ----------------------------------------------------------------------------------------------------- ## Changelog - -### ### 1.10.10 (2024-09-27) +### 1.10.11 (2024-11-02) +* BREAKING CHANGE +* +* bugs : ChannelScan is currently not available +* +* * (lebrinkma) fix linter errors * (asgothian) disable map display for deactivated devices * (asgothian) new option on map: disable physics interaction @@ -145,6 +149,7 @@ You can thank the authors by these links: * (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 +* (arteck) delete groups works again ### 1.10.9 (2024-09-05) * (arteck) typo admin settings @@ -170,7 +175,6 @@ You can thank the authors by these links: ### 1.10.3 (2024-04-06) * (arteck) dependency update -## Changelog ### 1.10.2 (2024-01-25) * (arteck) dependency update @@ -592,7 +596,6 @@ new Zigbee-herdsman features: * Some design update * Binding - ## License The MIT License (MIT) diff --git a/admin/adapter-settings.js b/admin/adapter-settings.js index 453066e2..66da9936 100644 --- a/admin/adapter-settings.js +++ b/admin/adapter-settings.js @@ -55,7 +55,7 @@ $(document).ready(function () { function loadSystemConfig(callback) { socket.emit('getObject', 'system.config', function (err, res) { if (!err && res && res.common) { - systemLang = res.common.language || systemLang; + // systemLang = res.common.language || systemLang; systemConfig = res; } socket.emit('getObject', 'system.certificates', function (err, res) { @@ -96,12 +96,12 @@ function loadSettings(callback) { if (typeof load === 'undefined') { alert('Please implement save function in your admin/index.html'); } else { - const _query = query.split('&'); + const _query = query.split('&'); for (let q = 0; q < _query.length; q++) { - if (_query[q].indexOf('react=') !== -1) { - $('.adapter-container').addClass('react-' + _query[q].substring(6)); - theme = 'react-' + _query[q].substring(6); - } + if (_query[q].indexOf('react=') !== -1) { + $('.adapter-container').addClass('react-' + _query[q].substring(6)); + theme = 'react-' + _query[q].substring(6); + } } load(res.native, onChange); } @@ -122,19 +122,19 @@ function loadSettings(callback) { window.addEventListener('resize', checkMediaQuery); function checkMediaQuery() { - const mediaQuery = window.matchMedia("(max-width: 600px)"); + const mediaQuery = window.matchMedia('(max-width: 600px)'); if (mediaQuery.matches) { designFix(); - console.log("Screen < 600px."); + console.log('Screen < 600px.'); } else { - console.log("Screen > 600px."); + console.log('Screen > 600px.'); } } // Design Fix simatec function designFix() { - var dropdownToggle = document.querySelector('.dropdown-toggle'); + const dropdownToggle = document.querySelector('.dropdown-toggle'); if (!dropdownToggle) { const cols = document.querySelectorAll('.col:not(.tab)'); diff --git a/admin/admin.js b/admin/admin.js index 8d772e27..d1d666bd 100644 --- a/admin/admin.js +++ b/admin/admin.js @@ -70,7 +70,7 @@ function getDevice(ieeeAddr) { }); } -// eslint-disable-next-line no-unused-vars + function getDeviceByNetwork(nwk) { return devices.find((devInfo) => { try { @@ -795,7 +795,7 @@ function getMap() { } // the function loadSettings has to exist ... -// eslint-disable-next-line no-unused-vars + function load(settings, onChange) { if (settings.panID === undefined) { settings.panID = 6754; @@ -984,7 +984,7 @@ function showPairingProcess() { // ... and the function save has to exist. // you have to make sure the callback is called with the settings object as first param! -// eslint-disable-next-line no-unused-vars + function save(callback) { const obj = {}; $('.value').each(function () { @@ -1312,7 +1312,7 @@ function showNetworkMap(devices, map) { nodes: nodesArray, edges: mapEdges }; - + network = new vis.Network(container, data, networkOptions); const onMapSelect = function (event) { @@ -2552,7 +2552,7 @@ function showChannels() { } } }); - showWaitingDialog('Scanning channels', 10); + showWaitingDialog('Scanning channels - not working yet', 10); } function onlyOne(devs) { diff --git a/admin/words.js b/admin/words.js index 03b5649d..b06babb2 100644 --- a/admin/words.js +++ b/admin/words.js @@ -82,7 +82,7 @@ systemDictionary = { "Type": { "uk": "Тип", "en": "Type", "de": "Typ", "ru": "Тип", "pt": "Tipo", "nl": "Type", "fr": "Type", "it": "genere", "es": "Tipo", "pl": "Typ", "zh-cn": "类型"}, "Unbind remote from Coordinator (necessary for some remotes like HUE Dimmer Switch)": {"uk": "Від’єднайте пульт від координатора (необхідно для деяких пультів, наприклад HUE Dimmer Switch)", "en": "Unbind remote from coordinator (necessary for some remotes like HUE Dimmer Switch)", "de": "Entkoppele die Fernbedienung vom Koordinator (erforderlich für einige Fernbedienungen wie HUE Dimmer Switch)", "ru": "Отсоедините пульт от координатора (необходим для некоторых пультов, таких как HUE Dimmer Switch)", "pt": "Desconecte o controle remoto do Coordinator (necessário para alguns controles remotos, como o HUE Dimmer Switch)", "nl": "Ontkoppel afstandsbediening van Coordinator (noodzakelijk voor sommige afstandsbedieningen zoals HUE Dimmer Switch)", "fr": "Dissocier la télécommande de coordination (nécessaire pour certaines télécommandes comme HUE Dimmer Switch)", "it": "Sblocca il telecomando da Coordinator (necessario per alcuni telecomandi come HUE Dimmer Switch)", "es": "Desvincule el control remoto del Coordinador (necesario para algunos controles remotos como HUE Dimmer Switch)", "pl": "Odłącz pilota od Coordinatora (niezbędny do niektórych pilotów, takich jak HUE Dimmer Switch)", "zh-cn": "从Coordinator取消绑定遥控器(对于某些遥控器,例如HUE Dimmer Switch,这是必需的)"}, "View config": { "uk": "Переглянути конфігурацію", "en": "View config", "de": "Konfiguration anzeigen", "ru": "Посмотреть конфигурацию", "pt": "Ver configuração", "nl": "Bekijk configuratie", "fr": "Afficher la configuration", "it": "Visualizza config", "es": "Ver configuración", "pl": "Wyświetl config", "zh-cn": "查看配置"}, - "Waiting": { "uk": "Очікування", "en": "Waiting", "de": "Warten", "ru": "Ожидание", "pt": "Esperando", "nl": "Wachtende", "fr": "Attendre", "it": "In attesa", "es": "Esperando", "pl": "Czekaj", "zh-cn": "等候"}, + "Waiting": { "uk": "Очікування", "en": "Waiting", "de": "Bitte Warten", "ru": "Ожидание", "pt": "Esperando", "nl": "Wachtende", "fr": "Attendre", "it": "In attesa", "es": "Esperando", "pl": "Czekaj", "zh-cn": "等候"}, "Write Attribute": { "uk": "Записати атрибут", "en": "Write attribute", "de": "Attribut schreiben", "ru": "Запись атрибута", "pt": "Gravar Atributo", "nl": "Schrijf attribuut", "fr": "Ecrire attribut", "it": "Scrivi attributo", "es": "Escribir atributo", "pl": "Napisz atrybut", "zh-cn": "写属性"}, "Yes": { "uk": "Так", "en": "Yes", "de": "Ja", "ru": "Да", "pt": "sim", "nl": "Ja", "fr": "Oui", "it": "sì", "es": "Sí", "pl": "Tak", "zh-cn": "是"}, "You find good explanations what the settings mean": {"uk": "Ви знайдете хороші пояснення значення налаштувань", "en": "You find good explanations what the settings mean", "de": "Sie finden gute Erklärungen, was die Einstellungen bedeuten", "ru": "Вы найдете хорошие объяснения, что означают настройки", "pt": "Você encontra boas explicações sobre o significado das configurações", "nl": "U vindt een goede uitleg wat de instellingen betekenen", "fr": "Vous trouvez de bonnes explications sur ce que signifient les paramètres", "it": "Trovi buone spiegazioni sul significato delle impostazioni", "es": "Encuentra buenas explicaciones de lo que significa la configuración", "pl": "Znajdziesz dobre wyjaśnienia, co oznaczają ustawienia", "zh-cn": "您会找到很好的解释,这些设置意味着什么"}, diff --git a/io-package.json b/io-package.json index ed921871..e41088bc 100644 --- a/io-package.json +++ b/io-package.json @@ -1,8 +1,21 @@ { "common": { "name": "zigbee", - "version": "1.10.10", + "version": "1.10.11", "news": { + "1.10.11": { + "en": "BREAKING CHANGE\n\nbugs : ChannelScan is currently not available\n\n\nfix linter errors\ndisable map display for deactivated devices\nnew option on map: disable physics interaction\nnew zigbee-herdsman-converters 20.28.0\nnew zigbee-herdsman 2.1.1\nAllow use of keyless converters (used for TuYa and compatible devices in zigbee-herdsman-converters\nswap from request to axios\ndelete groups works again", + "de": "VERWENDUNGSBEREICH\n\nbugs : ChannelScan ist derzeit nicht verfügbar\n\n\nlinterfehler beheben\nkartenanzeige für deaktivierte geräte deaktivieren\nneue option auf der karte: physik-interaktion deaktivieren\nneue zickbee-herdsman-konverter 20.28.0\nneuer zickbee-herdsman 2.1.1\nVerwenden von schlüssellosen Wandlern (für TuYa und kompatible Geräte in Zickbee-herdsman-Konverter verwendet)\nswap von anfrage an axios\nlöschen von gruppen funktioniert wieder", + "ru": "ОБМЕН\n\nжуки: ChannelScan в настоящее время не доступен\n\n\nисправление ошибок\nотключить отображение карты для деактивированных устройств\nновый вариант на карте: отключить взаимодействие физики\n20.28.0\n2.1.1\nПозволить использовать бесключевые конвертеры (используемые для TuYa и совместимые устройства в zigbee-herdsman-конвертерах\nсвопа от запроса к axios\nудалить группы снова", + "pt": "ALTERAÇÕES DE TRABALHO\n\nbugs : ChannelScan não está disponível\n\n\ncorrigir erros do linter\ndesativar a exibição do mapa para dispositivos desativados\nnova opção no mapa: desativar a interação física\nnovos conversores de zigbee-herdsman 20.28.0\nnovo zigbee-herdsman 2.1.1\nPermitir o uso de conversores sem chave (usado para TuYa e dispositivos compatíveis em conversores de zigbee-herdsman\nswap de pedido para axios\nexcluir grupos funciona novamente", + "nl": "BREAKING VERANDERING\n\nbugs: ChannelScan is momenteel niet beschikbaar\n\n\nrepareren linter fouten\nkaartweergave voor gedeactiveerde apparaten uitschakelen\nnieuwe optie op de kaart: interactie natuurkunde uitschakelen\nnieuwe zigbee-herdsman-converters 20.28.0\nnieuwe zigbee-herdsman 2.1.1\nGebruik van sleutelloze converters toestaan (gebruikt voor TuYa en compatibele apparaten in zigbee-herdsman-converters\nruil van verzoek naar axios\ngroepen opnieuw verwijderen", + "fr": "CHANGEMENT DE BREAING\n\nbugs : ChannelScan n'est actuellement pas disponible\n\n\ncorrection des erreurs linter\ndésactiver l'affichage de la carte pour les appareils désactivés\nnouvelle option sur la carte: désactiver l'interaction physique\nnouveaux convertisseurs zigbee-herdsman 20.28.0\nnouveau zigbee-herdsman 2.1.1\nPermettre l'utilisation de convertisseurs sans clé (utilisés pour TuYa et appareils compatibles dans les convertisseurs zigbee-herdsman-converters\néchange de la demande à l'axios\nsupprimer les groupes fonctionne à nouveau", + "it": "CAPITOLO DI RICERCA\n\nbugs: ChannelScan non è attualmente disponibile\n\n\ncorreggere gli errori di linter\ndisabilitare la visualizzazione della mappa per i dispositivi disattivati\nnuova opzione sulla mappa: disabilitare l'interazione fisica\nnuovo zigbee-herdsman-converters 20.28.0\nnuovo zigbee-herdsman 2.1.1\nConsentire l'uso di convertitori senza chiave (utilizzati per TuYa e dispositivi compatibili in zigbee-herdsman-converter\nswap da richiesta a assios\ncancellare i gruppi funziona di nuovo", + "es": "BREAKING CHANGE\n\nbugs : ChannelScan actualmente no está disponible\n\n\ncorrige errores de invierno\npantalla de mapa deshabilitado para dispositivos desactivados\nnueva opción en el mapa: la interacción física deshabilitada\nnuevos zigbee-herdsman-converters 20.28.0\nnuevo zigbee-herdsman 2.1.1\nPermitir el uso de convertidores sin llave (utilizados para TuYa y dispositivos compatibles en zigbee-herdsman-converters\nswap from request to axios\neliminar grupos funciona de nuevo", + "pl": "ZMIANA ZBIORCZA\n\nbłędy: ChannelScan jest obecnie niedostępny\n\n\nnaprawić błędy lintera\nwyłączyć wyświetlacz mapy dla wyłączonych urządzeń\nnowa opcja na mapie: wyłączenie interakcji fizyki\nnowe konwertery zigbee- herdsman- 20.28.0\nnowy zigbee-herdsman 2.1.1\nZezwalaj na stosowanie konwerterów bezklawiszowych (używanych dla TuYa i kompatybilnych urządzeń w konwerterach zigbee- herdsman-\nzamiana z wniosku na aksjos\nusuń grupy działa ponownie", + "uk": "БРЕАКІНГ ЗМІН\n\nпомилки : CanalScan наразі немає\n\n\nвиправлено помилки linter\nвідключення відображення карти для деактивованих пристроїв\nновий варіант на карті: відключена фізика взаємодія\nнові zigbee-herdsman-converters 20.28.0\nновий zigbee-herdsman 2.1.1\nДозволити використання без ключів конвертерів (використовується для TuYa та сумісних пристроїв в zigbee-herdsman-converters\nковтання від запиту в осях\nвидалити групи знову", + "zh-cn": "破坏变化\n\n错误 : 频道扫描目前不可用\n\n\n修正线性错误\n禁用已停用设备的地图显示\n地图上的新选项: 禁用物理交互\n新齐格比-牧民-转换器 20.28.0\n新齐格比牧民 2.1.1\n允许使用无密钥转换器( 用于 TuYa 和 Zigbee- herdsman- 转换器中的兼容设备)\n从请求转换为轴\n再次删除组工作" + }, "1.10.10": { "en": "core update\ndependency update", "de": "kern-update\naktualisierung der abhängigkeit", @@ -80,32 +93,6 @@ "pl": "icon ota aktualizacji urządzenia\nikona fix", "uk": "ota пристрій оновлення\nфіксатор ікони", "zh-cn": "图标 ota 设备更新\n图标修复" - }, - "1.10.4": { - "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.3": { - "en": "dependency update\n", - "de": "aktualisierung der abhängigkeit\n", - "ru": "обновление\n", - "pt": "atualização de dependência\n", - "nl": "afhankelijkheidsupdate\n", - "fr": "mise à jour de la dépendance\n", - "it": "aggiornamento della dipendenza\n", - "es": "actualización de la dependencia\n", - "pl": "aktualizacja zależności\n", - "uk": "оновлення залежності\n", - "zh-cn": "依赖性更新\n" } }, "titleLang": { @@ -213,8 +200,8 @@ "condition": { "operand": "and", "rules": [ - "oldVersion<=1.8.22", - "newVersion>=1.8.24" + "oldVersion<=1.10.3", + "newVersion>=1.10.10" ] }, "title": { @@ -230,16 +217,17 @@ "zh-cn": "重要通知!" }, "text": { - "en": "This new version use exposes for Aqara Button WXKG01LM. Plz select this device into exposes/Auschliessen tab", - "ru": "Эта новая версия использует экспозиции для Aqara Button WXKG01LM. Пожалуйста, выберите это устройство в exposes/Auschliessen tab", - "pt": "Esta nova versão usa expões para Aqara Button WXKG01LM. Por favor, selecione este dispositivo no separador exposes/Auschliessen", - "nl": "Deze nieuwe versie gebruikt blootstellingen voor Aqara Button WXK01LM. Kies alsjeblieft dit apparaat uit in de openbare aanklagers", - "fr": "Cette nouvelle version utilise pour Aqara Button WXKG01LM. Veuillez sélectionner cet appareil dans l'onglet Affichage/Auschliessen", - "it": "Questa nuova versione utilizza per Aqara Button WXKG01LM. Si prega di selezionare questo dispositivo per exposes/Auschliessen scheda", - "es": "Este nuevo uso expone para Aqara Button WXKG01LM. Por favor, seleccione este dispositivo en la pestaña exposes/Auschliessen", - "pl": "Nowa wersja została udostępniona dla zmian Aqary Button WXKG01LM. Prosze dodać to do exposes/Auschliessen tabsena", - "uk": "Ця нова версія використовується для кнопки Aqara Button WXKG01LM. Будь ласка, оберіть цей пристрій у вкладці ", - "zh-cn": "这一新版本用于Aqara Button WXKG01LM。 请选择这一装置暴露/Auschliessen tab" + "en": "\"BREAKING CHANGE. after update to this Version you can't go back to Version <= 1.10.3. Only option is your Backup", + "de": "\"BREAKING CHANGE. nach dem Update könnt ihr nicht zurück zu einer Version <= 1.10.3. Es geht nur per ioBroker Backup was hoffentlich gemacht habt", + "ru": "\"Изменяюсь. После обновления этой версии вы не можете вернуться к версии <= 1.10.3. Единственный вариант - это ваша резервная копия", + "pt": "\"BREAKING CHANGE. após a atualização para esta versão você não pode voltar para Versão <= 1.10.3. A única opção é o seu Backup", + "nl": "\"Verandering. Na update naar deze versie kun je niet meer terug naar versie <= 1.10.3. De enige optie is uw back-up", + "fr": "\"C'est le changement. après la mise à jour de cette version, vous ne pouvez pas retourner à la version <= 1.10.3. Seule option est votre sauvegarde", + "it": "\"Cambiare il cambiamento. dopo l'aggiornamento a questa versione non si può tornare alla versione <= 1.10.3. Solo l'opzione è il backup", + "es": "\"Cambiando. después de la actualización a esta versión no puede volver a la versión 0 = 1.10.3. La única opción es tu Backup", + "pl": "\"ZMIENIONA ZMIANA. po aktualizacji do tej wersji nie można wrócić do wersji < = 1.10.3. Jedyną opcją jest kopia zapasowa", + "uk": "\"Бреагування ЗМІНИ. після оновлення цієї версії ви не можете повернутися до версії <= 1.10.3. Тільки варіант - Ваш Резервне копіювання", + "zh-cn": "\"呼吸变化。 更新到此版本后, 您不能返回到 QQ 1. 10. 3. 版本 。 唯一的选项是您的备份" }, "link": "https://github.com/ioBroker/ioBroker.zigbee/blob/master/README.md", "level": "warn", diff --git a/lib/backup.js b/lib/backup.js index 39541943..78aaef96 100644 --- a/lib/backup.js +++ b/lib/backup.js @@ -133,7 +133,7 @@ class Backup { } } - // eslint-disable-next-line no-unused-vars + async listbackups(obj) { } diff --git a/lib/devices.js b/lib/devices.js index 613b8390..0fc50b8d 100644 --- a/lib/devices.js +++ b/lib/devices.js @@ -37,7 +37,7 @@ const comb = { } } }, - // eslint-disable-next-line no-unused-vars + effectJson: (state, value, options, disableQueue) => { if (state.id === states.effect_json.id) { const effectjson = {}; diff --git a/lib/groups.js b/lib/groups.js index f2d8eed3..0934020a 100644 --- a/lib/groups.js +++ b/lib/groups.js @@ -206,32 +206,8 @@ class Groups { } async deleteGroup(from, command, message) { - /* - const members = await this.getGroupMembersFromController(parseInt(message)); - if (members && members.length) { - for (const member of members) { - const devName = member.device.substring(2); - const groupEntry = this.adapter.getStateAsync(`${devName}.groups`); - const memberarray = (groupEntry && groupEntry.val) ? JSON.parse(groupEntry.val) : []; - const index = memberarray.indexOf(message.toString()); - if (index > -1) { - memberarray.splice(index, 1); - } - if (memberarray.length > 0) { - await this.adapter.setStateAsync(`${devName}.groups`, JSON.stringify(memberarray), true); - } - else { - await this.adapter.setStateAsync(`${devName}.groups`, '', true); - } - } - } - const groupsEntry = await this.adapter.getStateAsync('info.groups'); - const objGroups = (groupsEntry && groupsEntry.val ? JSON.parse(groupsEntry.val) : {}); - delete objGroups[message.toString()]; - await this.adapter.setStateAsync('info.groups', JSON.stringify(objGroups), true); - */ await this.zbController.removeGroupById(message); - await this.stController.deleteDeviceStatesAsync(`group_${parseInt(message)}`); + await this.stController.deleteGroupById(`group_${parseInt(message)}`); } async renameGroup(from, command, message) { diff --git a/lib/statescontroller.js b/lib/statescontroller.js index cf8f6ade..f4c57f09 100644 --- a/lib/statescontroller.js +++ b/lib/statescontroller.js @@ -226,7 +226,7 @@ class StatesController extends EventEmitter { const devStates = await this.getDevStates(deviceId, model); if (!devStates) { if (elevated) this.error(`ELEVATED no device states for device ${deviceId} type '${model}'`); - return; + return; } const commonStates = statesMapping.commonStates.find(statedesc => stateKey === statedesc.id); const stateDesc = (commonStates === undefined ? devStates.states.find(statedesc => stateKey === statedesc.id) : commonStates); @@ -319,17 +319,17 @@ class StatesController extends EventEmitter { }); } - async deleteDeviceStatesAsync(devId) { - const states = await this.adapter.getStatesOf(devId); - if (states) { - for (const state of states) { - await this.adapter.deleteState(devId, null, state._id); - } + async deleteGroupById(devId) { + const options = { recursive:true }; + try { + this.adapter.delObject(devId,options), (err) => { } + + } catch (err) { + this.adapter.log.info(`Cannot delete Group ${devId}: ${err}`); } - await this.adapter.delObject(devId); } - // eslint-disable-next-line no-unused-vars + async deleteOrphanedDeviceStates(ieeeAddr, model, force, callback) { const devStates = await this.getDevStates(ieeeAddr, model); const commonStates = statesMapping.commonStates; diff --git a/lib/zigbeecontroller.js b/lib/zigbeecontroller.js index 4e1aeab9..3020a144 100644 --- a/lib/zigbeecontroller.js +++ b/lib/zigbeecontroller.js @@ -1007,15 +1007,15 @@ class ZigbeeController extends EventEmitter { } async getChannelsEnergy() { - + /* const BLANK_EUI64 = "0xFFFFFFFFFFFFFFFF"; const SLEEPY = 0xffff; - + let clusterId = ZDO.ClusterId.NWK_UPDATE_REQUEST; //for (let i=26;i>0;i--) { - try + try { let result = {}; let payload = ZDO.Buffalo.buildRequest(false, clusterId, [11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26], 0x05, undefined, 0, undefined); @@ -1023,7 +1023,7 @@ class ZigbeeController extends EventEmitter { result = await this.herdsman.adapter.sendZdo(0x0, 0x0, clusterId , payload, false); this.warn(`result is ${JSON.stringify(result)}`) //await this.Wait(5000); - + //let payload1 = ZDO.Buffalo.buildRequest(true, clusterId, [16,17,18,19,20], 0x5, undefined, 0, undefined); //result = await this.herdsman.adapter.sendZdo(0x0, 0x0, clusterId , payload1, false); //this.warn(`result 2 is ${JSON.stringify(result)}`) @@ -1054,16 +1054,17 @@ class ZigbeeController extends EventEmitter { ); const result = await energyScan.start().promise; - */ + //return result.payload; } catch (error) { this.sendError(error); this.error(`Failed to touchlinkReset ${error.stack}`); - + } } -} + */ + } } module.exports = ZigbeeController; diff --git a/main.js b/main.js index 311342ce..9ea69b54 100644 --- a/main.js +++ b/main.js @@ -466,15 +466,15 @@ class Zigbee extends utils.Adapter { const cluster = message.cluster; const devId = device.ieeeAddr.substr(2); const meta = {device}; - + if (this.stController.checkDebugDevice(devId)) { const shortMessage = {}; - for(var propertyName in message) { + for(const propertyName in message) { shortMessage[propertyName] = message[propertyName]; - } - shortMessage.device = device.ieeeAddr; - shortMessage.meta = undefined; - shortMessage.endpoint = (message.endpoint.ID ? message.endpoint.ID: -1); + } + shortMessage.device = device.ieeeAddr; + shortMessage.meta = undefined; + shortMessage.endpoint = (message.endpoint.ID ? message.endpoint.ID: -1); this.log.warn(`ELEVATED: Zigbee Event of Type ${type} from device ${safeJsonStringify(device.ieeeAddr)}, incoming event: ${safeJsonStringify(shortMessage)}`); } // this assigment give possibility to use iobroker logger in code of the converters, via meta.logger @@ -636,7 +636,7 @@ 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}`); if (has_elevated_debug) this.log.warn(`ELEVATED: No mapped model for ${model}`) @@ -644,11 +644,11 @@ class Zigbee extends utils.Adapter { } if (!mappedModel.toZigbee) - { - this.log.error(`No toZigbee in mapped model for ${model}`); - return; - } - + { + this.log.error(`No toZigbee in mapped model for ${model}`); + return; + } + stateList.forEach(async changedState => { const stateDesc = changedState.stateDesc; const value = changedState.value; @@ -712,14 +712,14 @@ class Zigbee extends utils.Adapter { 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; - if (has_elevated_debug) this.log.warn(`ELEVATED: setting converter to keyless converter for ${deviceID} of type ${model}`) + if (has_elevated_debug) this.log.warn(`ELEVATED: setting converter to keyless converter for ${deviceId} of type ${model}`) this.log.debug('setting converter to keyless converter') continue; } @@ -731,7 +731,7 @@ class Zigbee extends utils.Adapter { } } -/* + /* 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))); */ @@ -740,7 +740,7 @@ class Zigbee extends utils.Adapter { 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) : {}; @@ -805,10 +805,10 @@ class Zigbee extends utils.Adapter { // process sync state list this.processSyncStatesList(deviceId, model, syncStateList); -// if (isGroup) { -// await this.callPluginMethod('queryGroupMemberState', [deviceId, stateDesc]); -// this.acknowledgeState(deviceId, model, stateDesc, value); -// } + // if (isGroup) { + // await this.callPluginMethod('queryGroupMemberState', [deviceId, stateDesc]); + // this.acknowledgeState(deviceId, model, stateDesc, value); + // } } else if (has_elevated_debug) this.log.warn(`Error convert result for ${key} with ${safeJsonStringify(preparedValue)} is undefined on device ${deviceId}.`); diff --git a/package-lock.json b/package-lock.json index 711be47f..b733069b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "iobroker.zigbee", - "version": "1.10.10", + "version": "1.10.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "iobroker.zigbee", - "version": "1.10.10", + "version": "1.10.11", "license": "MIT", "dependencies": { "@iobroker/adapter-core": "^3.1.3", diff --git a/package.json b/package.json index 27d8db22..14652224 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.zigbee", - "version": "1.10.10", + "version": "1.10.11", "author": { "name": "Kirov Ilya", "email": "kirovilya@gmail.com" diff --git a/support/docgen.js b/support/docgen.js index 9bf634cf..c0092e08 100644 --- a/support/docgen.js +++ b/support/docgen.js @@ -1,7 +1,7 @@ /** * This script generates the supported devices page. * - */ + let devices = [...require('zigbee-herdsman-converters').devices]; @@ -91,3 +91,5 @@ vendors.forEach((vendor) => { }); fs.writeFileSync(outputdir + '/' + file, text); + + */