Skip to content

Commit

Permalink
fix: Fix not all cluster unbound/bound when specified. #10740
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Jul 10, 2023
1 parent 813dd49 commit 0bdf663
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/extension/bind.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down Expand Up @@ -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' ||
Expand Down

0 comments on commit 0bdf663

Please sign in to comment.