Skip to content

Commit

Permalink
Zigbee2mqtt: Filter unknown models to prevent crash (#1997)
Browse files Browse the repository at this point in the history
  • Loading branch information
cicoub13 authored Jan 8, 2024
1 parent 396efc7 commit a967df5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/services/zigbee2mqtt/lib/getDiscoveredDevices.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ const { convertDevice } = require('../utils/convertDevice');
*/
function getDiscoveredDevices(filters = {}) {
let devices = Object.values(this.discoveredDevices)
// Filter unknown models
.filter((d) => d.definition !== null)
// Convert to Gladys device
.map((d) => convertDevice(d, this.serviceId))
.map((d) => {
Expand Down

0 comments on commit a967df5

Please sign in to comment.