From 4489ae228c7a720b7a0d3f750b8a6ec9bb791751 Mon Sep 17 00:00:00 2001 From: Rob van Oostenrijk Date: Fri, 6 Dec 2024 15:16:29 +0400 Subject: [PATCH] Update against zigbee2mqtt extension signature changes --- dist/automations.js | 5 ++++- src/automations.ts | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/dist/automations.js b/dist/automations.js index 2b344b9..72f7034 100644 --- a/dist/automations.js +++ b/dist/automations.js @@ -69,12 +69,15 @@ class InternalLogger { } } class AutomationsExtension { - constructor(zigbee, mqtt, state, publishEntityState, eventBus, settings, logger) { + constructor(zigbee, mqtt, state, publishEntityState, eventBus, enableDisableExtension, restartCallback, addExtension, settings, logger) { this.zigbee = zigbee; this.mqtt = mqtt; this.state = state; this.publishEntityState = publishEntityState; this.eventBus = eventBus; + this.enableDisableExtension = enableDisableExtension; + this.restartCallback = restartCallback; + this.addExtension = addExtension; this.settings = settings; this.logger = logger; this.eventAutomations = {}; diff --git a/src/automations.ts b/src/automations.ts index 5c63df0..04e992c 100644 --- a/src/automations.ts +++ b/src/automations.ts @@ -22,6 +22,7 @@ import type Zigbee from 'zigbee2mqtt/dist/zigbee'; import type MQTT from 'zigbee2mqtt/dist/mqtt'; import type State from 'zigbee2mqtt/dist/state'; import type EventBus from 'zigbee2mqtt/dist/eventBus'; +import type Extension from 'zigbee2mqtt/dist/extension/extension'; import type Settings from 'zigbee2mqtt/dist/util/settings'; import type Logger from 'zigbee2mqtt/dist/util/logger'; @@ -232,6 +233,9 @@ class AutomationsExtension { protected state: State, protected publishEntityState: unknown, protected eventBus: EventBus, + protected enableDisableExtension: (enable: boolean, name: string) => Promise, + protected restartCallback: () => Promise, + protected addExtension: (extension: Extension) => Promise, protected settings: typeof Settings, protected logger: typeof Logger, ) {