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

wants to merge 23 commits into from

Conversation

asgothian
Copy link
Collaborator

No description provided.

Deactivate map and ping
* (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)
Debug options
Allow use of legacy device definition through exposes functionality
admin/admin.js Fixed Show fixed Hide fixed
console.warn('toggleDebugDevices with id ' + id);
sendTo(namespace, 'setDeviceDebug', {id:id}, function (msg) {
sendTo(namespace, 'getDebugDevices', {}, function(msg) {
if (msg && typeof (msg.debugDevices == 'array')) {

Check warning

Code scanning / CodeQL

Useless conditional Warning

This expression always evaluates to true.

function getDevices() {
getCoordinatorInfo();
sendTo(namespace, 'getDebugDevices', {}, function(msg) {
if (msg && typeof (msg.debugDevices == 'array')) {

Check warning

Code scanning / CodeQL

Useless conditional Warning

This expression always evaluates to true.
status = (dev.link_quality > 0 && isActive) ? `<div class="col tool"><i class="material-icons icon-green">check_circle</i></div>` : (groupImage || !isActive ? '' : `<div class="col tool"><i class="material-icons icon-black">leak_remove</i></div>`),
permitJoinBtn = (isActive && dev.info && dev.info.device._type === 'Router') ? '<button name="join" class="btn-floating btn-small waves-effect waves-light right hoverable green"><i class="material-icons tiny">leak_add</i></button>' : '',
infoBtn = (nwk) ? `<button name="info" class="left btn-flat btn-small"><i class="material-icons icon-blue">info</i></button>` : '',
lq = (dev.link_quality > 0 && isActive) ? `<div class="col tool"><i id="${rid}_link_quality_icon" class="material-icons ${lqi_cls}">network_check</i><div id="${rid}_link_quality" class="center" style="font-size:0.7em">${dev.link_quality}</div></div>`

Check warning

Code scanning / CodeQL

Missing variable declaration Warning

Variable lq is used like a local variable, but is missing a declaration.
}
const stateKey = arr[1];
this.warn('statekey is ' + stateKey + ', arr is ' + JSON.stringify(arr) + ' id was ' + id);
if (typeof (this.debugDevices) != 'array') this.getDebugDevices(() => {

Check failure

Code scanning / CodeQL

Useless type test Error

The result of this 'typeof' expression is compared to
array
, but the two can never be equal.
}
if (!devStates) {
if (has_debug) this.error(`ELEVATED IE2: no device states for device ${devId} type '${model}'`)
if (has_elevated_debug)
this.elevatedMessage(devId, `ELEVATED IE02: no device states for device ${devId} type '${model}'`, true)

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (96% of all statements in
the enclosing function
have an explicit semicolon).
for (const stateInd in states) {
const statedesc = states[stateInd];
let value;
let extra_value = undefined;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable extra_value.
try {
this.warn(`Pinging '${ieeeAddr}' (${device.modelID})`)

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (95% of all statements in
the enclosing function
have an explicit semicolon).
const dev_block = $(this).parents('div.device');
const id = getDevId(dev_block);
const name = getDevName(dev_block);
toggleDebugDevice(id, name);

Check warning

Code scanning / CodeQL

Superfluous trailing arguments Warning

Superfluous argument passed to
function toggleDebugDevice
.

async function selectImageOverride(id) {
const dev = devices.find((d) => d._id == id);
let localImages = undefined;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable localImages.
excludes.forEach(id => {
// const b = devices.find((item) => item._id.contains(id));
const exclude_id = id.key;
const exclude_icon = id.value;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable exclude_icon.

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.

function pairedLegacyDevices(candidates) {
const rv = [];
for (const candidate in legacy_devices) {

Check failure

Code scanning / CodeQL

Unused loop iteration variable Error

For loop variable candidate is not used in the loop body.
}

async updateDeviceImage(target, isGlobal, image) {
const base = getOverrideData(target, isGlobal);

Check failure

Code scanning / CodeQL

Missing 'this' qualifier Error

This call refers to a global function, and not the local method
getOverrideData
.
@@ -6,7 +6,8 @@
const getZbId = require('./utils').getZbId;
const fs = require('fs');
const axios = require('axios');

const localConfig = require('./localConfig');
const { deviceAddCustomCluster } = require('zigbee-herdsman-converters/lib/modernExtend');

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable deviceAddCustomCluster.
async renameDevice(id, newName) {
const stateId = id.replace(`${this.adapter.namespace}.`, '')
const obj = await this.adapter.getObjectAsync(id);
if (newName == null || newName == undefined) newName = '';

Check notice

Code scanning / CodeQL

Unneeded defensive code Note

This guard always evaluates to false.
}

verifyDeviceName(id, name) {
const savedId = id.replace(`${this.adapter.namespace}.`, '');

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable savedId.
await this.herdsman.stop();
}
catch (error) {
this.warn(`Starting zigbee-herdsman problem : ${error && error.message ? error.message : 'no error message'}`)

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (98% of all statements in
the enclosing function
have an explicit semicolon).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant