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.11 #2363

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

1.11 #2363

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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ admin/i18n/*/flat.txt
debugidentify.js
.devcontainer
docs

*.png
.dev-server/
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@ You can thank the authors by these links:

-----------------------------------------------------------------------------------------------------
## Changelog
### 1.11.1 (2025-01-02)
* (asgothian) Fix Pairing
* (asgothian) change ping
* (asgothian) delay map generation until refresh is activated
* (asgothian) remove bindings tab from zigbee tab
* (asgothian) reorder tabs in configuration
* (asgothian) remove binding tab from configuration
* (asgothian) remove map from configuration
* (asgothian) add debug to zigbee tab (work in progress)
* (asgothian) Herdsman 3.2.0, Converters 21.11.0

### 1.10.14 (2025-01-01)
* (arteck) Herdsman 2.1.9, Converters 20.58.0
* (asgothian) Fix: Aqara T1M (CL-L02D)
Expand Down
203 changes: 164 additions & 39 deletions admin/admin.js

Large diffs are not rendered by default.

Binary file added admin/img/PTM 215Z.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added admin/img/ZY-M100-24GV3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 28 additions & 11 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,11 @@ <h5 class="translate">Zigbee adapter</h5>
</div>
<div class="nav-content">
<ul class="tabs tabs-transparent">
<li class="tab col s2"><a href="#tab-sett" id="settings" class="translate tooltipped">Settings</a></li>
<!--<li class="tab col s2"><a href="#tab-map" id="tabmap" class="translate tooltipped">Network map</a></li> -->
<!--<li class="tab col s1"><a href="#tab-binding" class="translate tooltipped">Binding</a></li> -->
<li class="tab col s2"><a href="#tab-exclude" class="translate tooltipped">Local Overrides</a></li>
<li class="tab col s2"><a href="#tab-main" id="devs" class="translate tooltipped">Devices</a></li>
<li class="tab col s2"><a href="#tab-map" id="tabmap" class="translate tooltipped">Network map</a>
</li>
<li class="tab col s1"><a href="#tab-binding" class="translate tooltipped">Binding</a></li>
<li class="tab col s2"><a href="#tab-exclude" class="translate tooltipped">Excludes</a></li>
<li class="tab col s2"><a href="#tab-sett" id="settings" class="translate tooltipped">Settings</a>
</li>
<li class="tab col s2"><a href="#tab-dev" id="develop" class="translate tooltipped">Developer</a>
</li>
</ul>
Expand Down Expand Up @@ -1329,13 +1327,32 @@ <h3 class="translate">Edit Group</h3>
</div>
</div>
</div>
</div>
<div id="chooseimage" class="modal">
<div class="modal-content">
<div class="row">
<h3 class="translate">Image override</h3>
<div class="row">
<div class="col s12 input-field">
<select id="images" class="icons">
</select>
<label for="images" class="translate">Image</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col s19 input-field">
<input id="globaloverride" type="checkbox" class="value"/>
<label class="translate" for="globaloverride">Apply to model</label>
</div>
</div>
<div class="modal-footer">
<a name="save" href="#!"
class="modal-action modal-close waves-effect waves-green btn green translate">Save</a>
<a name="save" href="#!" class="modal-action modal-close waves-effect waves-green btn green translate">Save</a>
<a href="#!" class="modal-action modal-close waves-effect waves-red btn-flat translate">Cancel</a>
</div>
</div>

<div id="codeentry" class="modal">
<div class="modal-content">
<div class="addgroup">
Expand Down Expand Up @@ -1531,12 +1548,12 @@ <h3 class="translate">Binding configuration</h3>
<div id="excludemodaledit" class="modal">
<div class="modal-content">
<div class="row">
<h3 class="translate">Exclude configuration</h3>
<h3 class="translate">Custom device configuration</h3>
<div class="row">
<div class="col s9 input-field">
<select id="exclude_target" class="icons">
</select>
<label for="exclude_target" class="translate">exclude device</label>
<label for="exclude_target" class="translate">use legacy implementation for device</label>
</div>
</div>
</div>
Expand Down
33 changes: 30 additions & 3 deletions admin/tab_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,9 @@ <h5 class="translate">Zigbee adapter</h5>
<li class="tab col s2"><a href="#tab-main" id="devs" class="translate">Devices</a></li>
<li class="tab col s2"><a href="#tab-map" id="tabmap" class="translate">Network map</a></li>
<li class="tab col s2"><a href="#tab-binding" class="translate">Binding</a></li>
<li class="tab col s2"><a href="#tab-exclude" class="translate">Excludes</a></li>
<!--li class="tab col s2"><a href="#tab-sett" id="settings" class="translate">Settings</a></li-->
<li class="tab col s2"><a href="#tab-debug" id="tabdebug" class="translate">Debug</a></li>
<!-- <li class="tab col s2"><a href="#tab-exclude" class="translate">Excludes</a></li>-->
<!-- li class="tab col s2"><a href="#tab-sett" id="settings" class="translate">Settings</a></li-->
<!-- li class="tab col s2"><a href="#tab-dev" id="develop" class="translate">Developer</a></li-->
</ul>
</div>
Expand Down Expand Up @@ -1099,7 +1100,33 @@ <h3 class="translate">Edit Group</h3>
</div>
</div>

<div id="modaldelete" class="modal">
<div id="chooseimage" class="modal">
<div class="modal-content">
<div class="row">
<h3 class="translate">Image override</h3>
<div class="row">
<div class="col s12 input-field">
<select id="images" class="icons">
</select>
<label for="images" class="translate">Image</label>
</div>
</div>
</div>
<div class="row">
<div class="col s19 input-field">
<input id="globaloverride" type="checkbox" class="value"/>
<label class="translate" for="globaloverride">Apply to model</label>
</div>
</div>
</div>
<div class="modal-footer">
<a name="save" href="#!" class="modal-action modal-close waves-effect waves-green btn green translate">Save</a>
<a href="#!" class="modal-action modal-close waves-effect waves-red btn-flat translate">Cancel</a>
</div>
</div>


<div id="modaldelete" class="modal">
<div class="modal-content">
<h3 class="translate">Delete confirmation</h3>
<p>A bunch of text</p>
Expand Down
29 changes: 15 additions & 14 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"common": {
"name": "zigbee",
"version": "1.10.15",
"version": "1.11.2",
"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.11.2": {
"en": "debug for states",
"de": "debug for states",
"ru": "debug for states",
"pt": "debug for states",
"nl": "debug for states",
"fr": "debug for states",
"it": "debug for states",
"es": "debug for states",
"pl": "debug for states",
"uk": "debug for states",
"zh-cn": "debug for states"
},
"1.10.14": {
"en": "Herdsman 2.1.9, Converters 20.58.0\nFix: Aqara T1M (CL-L02D) \ndeleteDeviceStates change to deleteObj",
Expand Down Expand Up @@ -222,7 +222,8 @@
"cancel"
]
}
]
],
"installedFrom": "asgothian/ioBroker.zigbee#1.11"
},
"native": {
"port": "",
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}: ${(e && e.message ? e.message : 'no error message')} ${(e && e.stack ? e.stack : 'no call stack')}`);
this.error(`Could not ${type} Coordinator from ${bind_source}: ${JSON.stringify(e)}`);
}
}
} catch (error) {
Expand Down
72 changes: 70 additions & 2 deletions lib/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
const fs = require('fs');
const pathLib = require('path');
const statesMapping = require('./devices');
const utils = require('@iobroker/adapter-core'); // Get common adapter utils

const disallowedDashStates = [
'link_quality', 'available', 'battery', 'groups', 'device_query',
'hue_move', 'color_temp_move', 'satuation_move', 'brightness_move', 'brightness_step', 'hue_calibration',
Expand Down Expand Up @@ -114,6 +116,27 @@
this.setDeviceActivated(obj.from, obj.command, obj.message, obj.callback);
}
break;
case 'setDeviceDebug':
if (obj.message && typeof obj.message === 'object') {
this.toggleDeviceDebug(obj.from, obj.command, obj.message, obj.callback);
}
break;
case 'getDebugDevices':
if (obj.message && typeof obj.message === 'object') {
this.getDebugDevices(obj.from, obj.command, obj.message, obj.callback);
}
break;

case 'getLocalImages':
if (obj.message && typeof obj.message === 'object') {
this.getLocalImages(obj.from, obj.command, obj.message, obj.callback);
}
break;
case 'updateDeviceImage':
if (obj.message && typeof obj.message === 'object') {
this.updateDeviceImage(obj.from, obj.command, obj.message, obj.callback);
}
break;
}
}
}
Expand Down Expand Up @@ -150,8 +173,8 @@
return;
}
}
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')}`);
catch (e) {
this.error(JSON.stringify(e));
this.adapter.sendTo(
from, command,
{error: 'Exception when trying to add QR code'},
Expand Down Expand Up @@ -209,6 +232,7 @@

async getDevices(from, command, id, callback) {
if (this.zbController) {
this.warn(`getDevices called from ${from} with command ${JSON.stringify(command)} and id ${JSON.stringify(id)}`);
const pairedDevices = await this.zbController.getClients(true);
const groups = {};
let rooms;
Expand Down Expand Up @@ -532,6 +556,50 @@
}
}

async toggleDeviceDebug(from, command, msg, callback) {
if (this.stController) {
const id = msg.id;
const result = await this.stController.toggleDeviceDebug(id);
this.adapter.sendTo(from, command, {debugDevices:result}, callback)
}
}

async getDebugDevices(from, command, msg, callback) {
if (this.stController) {
this.warn("get Debug Devices Called");
this.stController.getDebugDevices((debugDevices) => this.adapter.sendTo(from, command, {debugDevices:debugDevices}, callback));
}
}


async getLocalImages(from, command, msg, callback) {
if (this.stController) {
const id = msg.id;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable id.
const result = await this.stController.localConfig.enumerateImages(utils.getAbsoluteInstanceDataDir(this.adapter).replace('.','_'));
this.adapter.sendTo(from, command, {imageData:result}, callback)
}
}

async updateDeviceImage(from, command, msg, callback) {
if (this.stController) {
this.warn(`UpdateDeviceImage : ${JSON.stringify(msg)}`)
const target = msg.global ? msg.target : msg.target.replace(`${this.adapter.namespace}.`, '')
const result = await this.stController.localConfig.updateLocalOverride(target, 'icon', msg.image, msg.global);
if (msg.name) {
this.stController.localConfig.updateLocalOverride(target, 'name', msg.name, msg.global);
}

if (!msg.global) {
const entity = await this.zbController.resolveEntity(`0x${target}`);
this.stController.updateDev(target, 'entity.mapped.model', entity.mapped.model, () => {this.adapter.sendTo(from, command, {imageData:result}, callback)});
}
else {
//this.error(JSON.stringify(result));
this.adapter.sendTo(from, command, {imageData:result}, callback);
}
}
}

async reconfigure(from, command, msg, callback) {
if (this.zbController) {
const devid = getZbId(msg.id);
Expand Down
Loading
Loading