From 0bdf663ca126d0569b62871e1b787992472faea4 Mon Sep 17 00:00:00 2001 From: koenkk Date: Mon, 10 Jul 2023 20:00:57 +0200 Subject: [PATCH] fix: Fix not all cluster unbound/bound when specified. https://github.com/Koenkk/zigbee2mqtt/issues/10740 --- lib/extension/bind.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/extension/bind.ts b/lib/extension/bind.ts index 08247dd20e..39041bca1e 100755 --- a/lib/extension/bind.ts +++ b/lib/extension/bind.ts @@ -12,7 +12,7 @@ import Group from '../model/group'; const legacyApi = settings.get().advanced.legacy_api; const legacyTopicRegex = new RegExp(`^${settings.get().mqtt.base_topic}/bridge/(bind|unbind)/.+$`); const topicRegex = new RegExp(`^${settings.get().mqtt.base_topic}/bridge/request/device/(bind|unbind)`); -const clusterCandidates = ['genScenes', 'genOnOff', 'genLevelCtrl', 'lightingColorCtrl', 'closuresWindowCovering', +const allClusterCandidates = ['genScenes', 'genOnOff', 'genLevelCtrl', 'lightingColorCtrl', 'closuresWindowCovering', 'hvacThermostat', 'msIlluminanceMeasurement', 'msTemperatureMeasurement', 'msRelativeHumidity', 'msSoilMoisture', 'msCO2']; @@ -246,8 +246,8 @@ export default class Bind extends Extension { // Find which clusters are supported by both the source and target. // Groups are assumed to support all clusters. + const clusterCandidates = clusters ?? allClusterCandidates; for (const cluster of clusterCandidates) { - if (clusters && !clusters.includes(cluster)) continue; let matchingClusters = false; const anyClusterValid = utils.isZHGroup(bindTarget) || typeof bindTarget === 'number' ||