diff --git a/lib/model/device.ts b/lib/model/device.ts index a590035f5..906bfcac4 100644 --- a/lib/model/device.ts +++ b/lib/model/device.ts @@ -18,6 +18,7 @@ export default class Device { public zh: zh.Device; public definition?: zhc.Definition; private _definitionModelID?: string; + #isResolvingDefinition?: boolean; get ieeeAddr(): string { return this.zh.ieeeAddr; @@ -64,9 +65,11 @@ export default class Device { } async resolveDefinition(ignoreCache = false): Promise { - if (this.interviewed && (!this.definition || this._definitionModelID !== this.zh.modelID || ignoreCache)) { + if (this.interviewed && !this.#isResolvingDefinition && (!this.definition || this._definitionModelID !== this.zh.modelID || ignoreCache)) { + this.#isResolvingDefinition = true; this.definition = await zhc.findByDevice(this.zh, true); this._definitionModelID = this.zh.modelID; + this.#isResolvingDefinition = false; } }