MCPcopy
hub / github.com/homebridge/homebridge / initializePlugin

Method initializePlugin

src/pluginManager.ts:209–221  ·  view source on GitHub ↗
(plugin: Plugin, identifier: string)

Source from the content-addressed store, hash-verified

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) {

Callers 2

loadPluginMethod · 0.80

Calls 2

errorMethod · 0.80
initializeMethod · 0.45

Tested by

no test coverage detected