(plugin: Plugin, identifier: string)
| 207 | } |
| 208 | |
| 209 | public async initializePlugin(plugin: Plugin, identifier: string): Promise<void> { |
| 210 | try { |
| 211 | this.currentInitializingPlugin = plugin |
| 212 | await plugin.initialize(this.api) // call the plugin's initializer and pass it our API instance |
| 213 | } catch (error: any) { |
| 214 | log.error('====================') |
| 215 | log.error(`ERROR INITIALIZING PLUGIN ${identifier}:`) |
| 216 | log.error(error.stack) |
| 217 | log.error('====================') |
| 218 | |
| 219 | this.plugins.delete(identifier) |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | private handleRegisterAccessory(name: AccessoryName, constructor: AccessoryPluginConstructor, pluginIdentifier?: PluginIdentifier): void { |
| 224 | if (!this.currentInitializingPlugin) { |
no test coverage detected