Skip to content

Commit ef2c939

Browse files
authored
fix: Don't call onEvent on disabled devices (#23058)
As z2m requires a restart for enable/disable to be effective, we don't need to handle changes at runtime (stop events etc)
1 parent 85356a2 commit ef2c939

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/extension/onEvent.ts

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export default class OnEvent extends Extension {
4040
}
4141

4242
private async callOnEvent(device: Device, type: zhc.OnEventType, data: KeyValue): Promise<void> {
43+
if (device.options.disabled) return;
4344
const state = this.state.get(device);
4445
await zhc.onEvent(type, data, device.zh);
4546

0 commit comments

Comments
 (0)