Skip to content

Commit

Permalink
Merge branch 'master' into 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
asgothian authored Jan 30, 2025
2 parents 2308bc4 + 99e52f0 commit 82bf0ec
Show file tree
Hide file tree
Showing 11 changed files with 267 additions and 204 deletions.
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
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,4 +219,28 @@ You can thank the authors by these links:
* Some design update
* Binding


------------------------------------------------------------------------------

## License
The MIT License (MIT)

Copyright (c) 2018-2025 Kirov Ilya <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
41 changes: 1 addition & 40 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,45 +67,6 @@
"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",
"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",
"ru": "настройки admin\neslint config",
"pt": "configurações de administração do tipo\neslint config",
"nl": "typo admin instellingen\neslint config",
"fr": "paramètres d'administration typo\nconfig eslint",
"it": "impostazioni dell'amministratore\neslint config",
"es": "configuración de administración de tipo\neslint config",
"pl": "ustawienia admin typo\neslint config",
"uk": "параметри адміністратора\neslint config",
"zh-cn": "类型管理员设置\n埃斯林特配置"
},
"1.10.8": {
"en": "corr admin settings\nadd new eslint version\n",
"de": "korr admin einstellungen\nneue eslint-version hinzufügen\n",
"ru": "настройки администрирования\nдобавить новую версию eslint\n",
"pt": "configurações de administração de corrimento\nadicionar nova versão eslint\n",
"nl": "corr admin instellingen\nnieuwe eslint versie toevoegen\n",
"fr": "paramètres d'administration corr\najouter une nouvelle version eslint\n",
"it": "impostazioni dell'amministratore\naggiungere nuova versione eslint\n",
"es": "configuración de administración de corr\nañadir nueva versión eslint\n",
"pl": "ustawienia admin corr\ndodaj nową wersję eslint\n",
"uk": "корр налаштування адміністратора\nдодати нову версію eslint\n",
"zh-cn": "corr 管理员设置\n添加新的 eslint 版本\n"
}
},
"titleLang": {
Expand Down Expand Up @@ -205,7 +166,7 @@
],
"dependencies": [
{
"js-controller": ">=3.3.0"
"js-controller": ">=5.0.19"
}
],
"messages": [
Expand Down
2 changes: 1 addition & 1 deletion lib/binding.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class Binding {
await this.doBindUnbind(type, bind_source, bind_source_ep, 'coordinator', '1');
this.debug('Successfully ' + (type === 'bind' ? 'bound' : 'unbound') + ' Coordinator from ' + bind_source);
} catch (e) {
this.error(`Could not ${type} Coordinator from ${bind_source}: ${JSON.stringify(e)}`);
this.error(`Could not ${type} Coordinator from ${bind_source}: ${(e && e.message ? e.message : 'no error message')} ${(e && e.stack ? e.stack : 'no call stack')}`);
}
}
} catch (error) {
Expand Down
4 changes: 2 additions & 2 deletions lib/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ class Commands {
return;
}
}
catch (e) {
this.error(JSON.stringify(e));
catch (error) {
this.error(`Pairing with code failed with: ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`);
this.adapter.sendTo(
from, command,
{error: 'Exception when trying to add QR code'},
Expand Down
8 changes: 4 additions & 4 deletions lib/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Groups {
}

} catch (error) {
if (error) this.error(`getGroupMembersFromController: error is ${JSON.stringify(error)} ${JSON.stringify(new Error().stack)}`);
if (error) this.error(`getGroupMembersFromController: error is ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`);
else this.error('unidentifed error in getGroupMembersFromController');
}
return members;
Expand Down Expand Up @@ -138,15 +138,15 @@ class Groups {
for (const gpid of groups[epid]) {
const gpidn = parseInt(gpid);
if (gpidn < 0) {
this.warn(`calling removeDevFromGroup with ${sysid}, ${-gpidn}, ${epid}` );
this.debug(`calling removeDevFromGroup with ${sysid}, ${-gpidn}, ${epid}` );
const response = await this.zbController.removeDevFromGroup(sysid, (-gpidn), epid);
if (response && response.error) {
errors.push(response.error);
this.error(`remove dev from group Error: ${JSON.stringify(response.error)}`);
}

} else if (gpidn > 0) {
this.warn(`calling addDevToGroup with ${sysid}, ${gpidn}, ${epid}` );
this.debug(`calling addDevToGroup with ${sysid}, ${gpidn}, ${epid}` );
const response = await this.zbController.addDevToGroup(sysid, (gpidn), epid);
if (response && response.error) {
errors.push(response.error);
Expand All @@ -158,7 +158,7 @@ class Groups {
}
}
} catch (e) {
this.warn('caught error ' + JSON.stringify(e) + ' in updateGroupMembership');
this.warn('caught error ' + (e && e.message ? e.message : 'no error message') + ' in updateGroupMembership');
this.adapter.sendTo(from, command, {error: e}, callback);
return;
}
Expand Down
10 changes: 5 additions & 5 deletions lib/statescontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ class StatesController extends EventEmitter {
retainDeviceNames() {
clearTimeout(this.retTimeoutHandle);
this.retTimeoutHanlde = setTimeout(() => {
fs.writeFile(this.dev_names_fn, JSON.stringify(savedDeviceNamesDB, null, 2), err => {
if (err) {
this.error(`error saving device names: ${JSON.stringify(err)}`);
fs.writeFile(this.dev_names_fn, JSON.stringify(savedDeviceNamesDB, null, 2), error => {
if (error) {
this.error(`error saving device names: ${(error && error.message ? error.message : 'no error message')} ${(error && error.stack ? error.stack : 'no call stack')}`);
} else {
this.debug('saved device names');
}
Expand Down Expand Up @@ -127,7 +127,7 @@ class StatesController extends EventEmitter {
}

if (this.checkDebugDevice(id))
this.warn(`ELEVATED O1: User state change of state ${id} with value ${state.val} (ack: ${state.ack}) from ${state.from}`);
this.warn(`ELEVATED O01: User state change of state ${id} with value ${state.val} (ack: ${state.ack}) from ${state.from}`);

this.debug(`User stateChange ${id} ${JSON.stringify(state)}`);
const devId = getAdId(this.adapter, id); // iobroker device id
Expand Down Expand Up @@ -229,7 +229,7 @@ class StatesController extends EventEmitter {
this.debug(`Change state '${stateKey}' at device ${deviceId} type '${model}'`);
const elevated = this.checkDebugDevice(deviceId);

if (elevated) this.warn(`ELEVATED O2: Change state '${stateKey}' at device ${deviceId} type '${model}'`);
if (elevated) this.warn(`ELEVATED O02: Change state '${stateKey}' at device ${deviceId} type '${model}'`);

const devStates = await this.getDevStates(deviceId, model);
if (!devStates) {
Expand Down
2 changes: 1 addition & 1 deletion lib/zbDeviceAvailability.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class DeviceAvailability extends BaseExtension {
}
} catch (error) {
this.sendError(error);
this.debug(`Exception in readState of '${device.ieeeAddr}' - error : '${error}'`);
this.debug(`Exception in readState of '${device.ieeeAddr}' - error : '${(error && error.message ? error.message : 'no error message')}'`);
// intentionally empty: Just present to ensure we cause no harm
// when reading the state fails. => fall back on standard Ping function
}
Expand Down
15 changes: 13 additions & 2 deletions lib/zbDeviceEvent.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,22 @@ class DeviceEvent extends BaseExtension {

async callOnEvent(device, type, data, mappedDevice) {
if (!mappedDevice) {
mappedDevice = await zigbeeHerdsmanConverters.findByDevice(device);
try {
mappedDevice = await zigbeeHerdsmanConverters.findByDevice(device);
}
catch (error) {
this.log.error(`onEvent: unable to find mapped device for ${JSON.stringify(device)} `);
return;
}
}

if (mappedDevice && mappedDevice.onEvent) {
mappedDevice.onEvent(type, data, device,mappedDevice.options,'{}');
try {
mappedDevice.onEvent(type, data, device,mappedDevice.options,'{}');
}
catch (error) {
this.log.error(`onEvent for ${JSON.stringify(device)} failed with error ${error.message}`);
}
}
}
}
Expand Down
Loading

0 comments on commit 82bf0ec

Please sign in to comment.