mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-27 21:20:03 +00:00
Fix homeassistant discover crash when device undefined.
This commit is contained in:
+3
-1
@@ -36,7 +36,9 @@ class Controller {
|
||||
if (settings.get().homeassistant) {
|
||||
// MQTT discovery of all paired devices on startup.
|
||||
this.zigbee.getAllClients().forEach((device) => {
|
||||
homeassistant.discover(device.ieeeAddr, deviceMapping[device.modelId].homeassistant, this.mqtt);
|
||||
if (deviceMapping[device.modelId]) {
|
||||
homeassistant.discover(device.ieeeAddr, deviceMapping[device.modelId].homeassistant, this.mqtt);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user