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)
This commit is contained in:
ghoz
2024-06-15 10:26:06 +02:00
committed by GitHub
parent 85356a2932
commit ef2c939482
+1
View File
@@ -40,6 +40,7 @@ export default class OnEvent extends Extension {
}
private async callOnEvent(device: Device, type: zhc.OnEventType, data: KeyValue): Promise<void> {
if (device.options.disabled) return;
const state = this.state.get(device);
await zhc.onEvent(type, data, device.zh);