Skip to content

Commit 711060a

Browse files
committed
fix: Fix custom cluster missing in configure Koenkk/zigbee2mqtt#23993
1 parent 615eb00 commit 711060a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/lib/modernExtend.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -2312,13 +2312,16 @@ export function deviceEndpoints(args: {endpoints: {[n: string]: number}; multiEn
23122312
}
23132313

23142314
export function deviceAddCustomCluster(clusterName: string, clusterDefinition: ClusterDefinition): ModernExtend {
2315-
const onEvent: OnEvent = async (type, data, device, options, state: KeyValue) => {
2315+
const addCluster = (device: Zh.Device) => {
23162316
if (!device.customClusters[clusterName]) {
23172317
device.addCustomCluster(clusterName, clusterDefinition);
23182318
}
23192319
};
23202320

2321-
return {onEvent, isModernExtend: true};
2321+
const onEvent: OnEvent = async (type, data, device, options, state: KeyValue) => addCluster(device);
2322+
const configure: Configure[] = [async (device) => addCluster(device)];
2323+
2324+
return {onEvent, configure, isModernExtend: true};
23222325
}
23232326

23242327
export function ignoreClusterReport(args: {cluster: string | number}): ModernExtend {

0 commit comments

Comments
 (0)