mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 05:24:29 +00:00
Fix lint.
This commit is contained in:
+10
-10
@@ -45,26 +45,26 @@ class Controller {
|
||||
|
||||
if (settings.get().advanced.report) {
|
||||
this.extensions.push(new ExtensionDeviceReport(
|
||||
this.zigbee, this.mqtt, this.state, this.publishEntityState
|
||||
this.zigbee, this.mqtt, this.state, this.publishEntityState,
|
||||
));
|
||||
}
|
||||
|
||||
if (settings.get().homeassistant) {
|
||||
this.extensions.push(new ExtensionHomeAssistant(
|
||||
this.zigbee, this.mqtt, this.state, this.publishEntityState
|
||||
this.zigbee, this.mqtt, this.state, this.publishEntityState,
|
||||
));
|
||||
}
|
||||
|
||||
/* istanbul ignore next */
|
||||
if (settings.get().advanced.soft_reset_timeout !== 0) {
|
||||
this.extensions.push(new ExtensionSoftReset(
|
||||
this.zigbee, this.mqtt, this.state, this.publishEntityState
|
||||
this.zigbee, this.mqtt, this.state, this.publishEntityState,
|
||||
));
|
||||
}
|
||||
|
||||
if (settings.get().advanced.availability_timeout) {
|
||||
this.extensions.push(new ExtensionDeviceAvailability(
|
||||
this.zigbee, this.mqtt, this.state, this.publishEntityState
|
||||
this.zigbee, this.mqtt, this.state, this.publishEntityState,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ class Controller {
|
||||
logger.error(`\t - ${error}`);
|
||||
}
|
||||
logger.error(
|
||||
`If you don't know how to solve this, read https://www.zigbee2mqtt.io/configuration/configuration.html`
|
||||
`If you don't know how to solve this, read https://www.zigbee2mqtt.io/configuration/configuration.html`,
|
||||
);
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ class Controller {
|
||||
(entity.mapped ?
|
||||
`${entity.mapped.model} - ${entity.mapped.vendor} ${entity.mapped.description} ` :
|
||||
'Not supported ') +
|
||||
`(${entity.device.type})`
|
||||
`(${entity.device.type})`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ class Controller {
|
||||
logger.debug(
|
||||
`Received Zigbee message from '${name}', type '${data.type}', cluster '${data.cluster}'` +
|
||||
`, data '${JSON.stringify(data.data)}' from endpoint ${data.endpoint.ID}` +
|
||||
(data.hasOwnProperty('groupID') ? ` with groupID ${data.groupID}` : ``)
|
||||
(data.hasOwnProperty('groupID') ? ` with groupID ${data.groupID}` : ``),
|
||||
);
|
||||
} else if (type === 'deviceJoined') {
|
||||
logger.info(`Device '${name}' joined`);
|
||||
@@ -192,7 +192,7 @@ class Controller {
|
||||
if (entity.mapped) {
|
||||
const {vendor, description, model} = entity.mapped;
|
||||
logger.info(
|
||||
`Device '${name}' is supported, identified as: ${vendor} ${description} (${model})`
|
||||
`Device '${name}' is supported, identified as: ${vendor} ${description} (${model})`,
|
||||
);
|
||||
|
||||
const log = {friendly_name: name, model, vendor, description, supported: true};
|
||||
@@ -200,7 +200,7 @@ class Controller {
|
||||
} else {
|
||||
logger.warn(
|
||||
`Device '${name}' with Zigbee model '${data.device.modelID}' is NOT supported, ` +
|
||||
`please follow https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html`
|
||||
`please follow https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html`,
|
||||
);
|
||||
this.mqtt.log('pairing', 'interview_successful', {friendly_name: name, supported: false});
|
||||
}
|
||||
@@ -227,7 +227,7 @@ class Controller {
|
||||
// Call extensions
|
||||
this.callExtensionMethod(
|
||||
'onZigbeeEvent',
|
||||
[type, data, entity ? entity.mapped : null, entity ? entity.settings : null]
|
||||
[type, data, entity ? entity.mapped : null, entity ? entity.settings : null],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,16 +52,16 @@ class DeviceBind extends BaseExtension {
|
||||
|
||||
logger.info(
|
||||
`Successfully ${type === 'bind' ? 'bound' : 'unbound'} cluster '${cluster}' from ` +
|
||||
`'${sourceName}' to '${targetName}'`
|
||||
`'${sourceName}' to '${targetName}'`,
|
||||
);
|
||||
this.mqtt.log(
|
||||
`device_${type}`,
|
||||
{from: sourceName, to: targetName, cluster}
|
||||
{from: sourceName, to: targetName, cluster},
|
||||
);
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`Failed to ${type} cluster '${cluster}' from '${sourceName}' to ` +
|
||||
`'${targetName}' (${error})`
|
||||
`'${targetName}' (${error})`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ class DeviceConfigure extends BaseExtension {
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`Failed to configure '${settingsDevice.friendlyName}', ` +
|
||||
`attempt ${this.attempts[device.ieeeAddr] + 1} (${error.stack})`
|
||||
`attempt ${this.attempts[device.ieeeAddr] + 1} (${error.stack})`,
|
||||
);
|
||||
this.attempts[device.ieeeAddr]++;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ class DeviceGroupMembership extends BaseExtension {
|
||||
}
|
||||
|
||||
const response = await entity.endpoint.command(
|
||||
`genGroups`, 'getMembership', {groupcount: 0, grouplist: []}, {}, true
|
||||
`genGroups`, 'getMembership', {groupcount: 0, grouplist: []}, {}, true,
|
||||
);
|
||||
|
||||
const {grouplist, capacity} = response;
|
||||
|
||||
@@ -90,7 +90,7 @@ class DeviceReceive extends BaseExtension {
|
||||
const level = ['readResponse', 'raw'].includes(data.type) ? 'debug' : 'warn';
|
||||
logger[level](
|
||||
`No converter available for '${mappedDevice.model}' with cluster '${data.cluster}' ` +
|
||||
`and type '${data.type}' and data '${JSON.stringify(data.data)}'`
|
||||
`and type '${data.type}' and data '${JSON.stringify(data.data)}'`,
|
||||
);
|
||||
logger[level](`Please see: https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html.`);
|
||||
return;
|
||||
|
||||
@@ -76,7 +76,7 @@ class DeviceReport extends BaseExtension {
|
||||
await endpoint.bind(cluster, this.coordinatorEndpoint);
|
||||
await endpoint.configureReporting(cluster, configuration);
|
||||
logger.info(
|
||||
`Succesfully setup reporting for '${device.ieeeAddr}' - ${endpoint.ID} - ${cluster}`
|
||||
`Succesfully setup reporting for '${device.ieeeAddr}' - ${endpoint.ID} - ${cluster}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ class DeviceReport extends BaseExtension {
|
||||
device.meta.reporting = reportKey;
|
||||
} catch (error) {
|
||||
logger.error(
|
||||
`Failed to setup reporting for '${device.ieeeAddr}' - ${error.stack}`
|
||||
`Failed to setup reporting for '${device.ieeeAddr}' - ${error.stack}`,
|
||||
);
|
||||
|
||||
this.failed.add(device.ieeeAddr);
|
||||
@@ -145,7 +145,7 @@ class DeviceReport extends BaseExtension {
|
||||
*/
|
||||
const polls = pollOnMessage.filter((p) =>
|
||||
p.cluster[message.cluster] && p.cluster[message.cluster].find((c) => c.type === message.type &&
|
||||
utils.equalsPartial(message.data, c.data))
|
||||
utils.equalsPartial(message.data, c.data)),
|
||||
);
|
||||
|
||||
if (polls.length) {
|
||||
|
||||
@@ -56,7 +56,7 @@ class NetworkMap extends BaseExtension {
|
||||
// Add the device short network address, ieeaddr and scan note (if any)
|
||||
labels.push(
|
||||
`${device.ieeeAddr} (${device.networkAddress})` +
|
||||
((device.failed && device.failed.length) ? `failed: ${device.failed.join(',')}` : '')
|
||||
((device.failed && device.failed.length) ? `failed: ${device.failed.join(',')}` : ''),
|
||||
);
|
||||
|
||||
// Add the device model
|
||||
|
||||
+1
-1
@@ -122,7 +122,7 @@ class Zigbee extends events.EventEmitter {
|
||||
resolveEntity(key) {
|
||||
assert(
|
||||
typeof key === 'string' || typeof key === 'number' ||
|
||||
key.constructor.name === 'Device', `Wrong type '${typeof key}'`
|
||||
key.constructor.name === 'Device', `Wrong type '${typeof key}'`,
|
||||
);
|
||||
|
||||
if (typeof key === 'string' || typeof key === 'number') {
|
||||
|
||||
Reference in New Issue
Block a user