mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-21 18:19:51 +00:00
Fix crash on MQTT message device model not known.
This commit is contained in:
+13
-1
@@ -412,7 +412,19 @@ class Controller {
|
||||
}
|
||||
|
||||
// Find ep for this device
|
||||
const mappedModel = zigbeeShepherdConverters.findByZigbeeModel(this.zigbee.getDevice(deviceID).modelId);
|
||||
const device = this.zigbee.getDevice(deviceID);
|
||||
if (!device) {
|
||||
logger.error(`Failed to find device with deviceID ${deviceID}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const mappedModel = zigbeeShepherdConverters.findByZigbeeModel(device.modelId);
|
||||
if (!mappedModel) {
|
||||
logger.warn(`Device with modelID '${device.modelId}' is not supported.`);
|
||||
logger.warn(`Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices`);
|
||||
return;
|
||||
}
|
||||
|
||||
const ep = mappedModel.ep && mappedModel.ep[topicPrefix] ? mappedModel.ep[topicPrefix] : null;
|
||||
const published = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user