mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 05:24:29 +00:00
+9
-3
@@ -42,7 +42,7 @@ class Controller {
|
||||
if (error) {
|
||||
logger.error('Failed to start');
|
||||
} else {
|
||||
// Log zigbee clients on startup.
|
||||
// Log zigbee clients on startup and configure.
|
||||
const devices = this.zigbee.getAllClients();
|
||||
logger.info(`Currently ${devices.length} devices are joined:`);
|
||||
devices.forEach((device) => {
|
||||
@@ -145,8 +145,14 @@ class Controller {
|
||||
if (ieeeAddr && device.modelId && !this.configuredReport.includes(ieeeAddr)) {
|
||||
const mappedModel = zigbeeShepherdConverters.findByZigbeeModel(device.modelId);
|
||||
|
||||
if (mappedModel && mappedModel.report) {
|
||||
this.zigbee.configureReport(ieeeAddr, mappedModel.report);
|
||||
if (mappedModel && mappedModel.configure) {
|
||||
mappedModel.configure(ieeeAddr, this.zigbee.shepherd, this.zigbee.getCoordinator(), (ok, msg) => {
|
||||
if (ok) {
|
||||
logger.info(`Succesfully configured ${ieeeAddr}`);
|
||||
} else {
|
||||
logger.error(`Failed to configure ${ieeeAddr}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.configuredReport.push(ieeeAddr);
|
||||
|
||||
Reference in New Issue
Block a user