Skip to content

Commit

Permalink
this.mappedDevice is null
Browse files Browse the repository at this point in the history
  • Loading branch information
arteck authored Nov 15, 2023
1 parent f38ae95 commit 0680723
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/zbDeviceConfigure.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ class DeviceConfigure extends BaseExtension {
this.info(`Configuring ${device.ieeeAddr} ${device.modelID}`);
const coordinatorEndpoint = await this.zigbee.getDevicesByType('Coordinator')[0].endpoints[0];
try {
await this.mappedDevice.configure(device, coordinatorEndpoint, this);
device.meta.configured = zigbeeHerdsmanConverters.getConfigureKey(mappedDevice);
device.save();
this.info(`DeviceConfigure successful ${device.ieeeAddr} ${device.modelID}`);
if (this.mappedDevice !== null && this.mappedDevice !== undefined) {
await this.mappedDevice.configure(device, coordinatorEndpoint, this);
device.meta.configured = zigbeeHerdsmanConverters.getConfigureKey(mappedDevice);
device.save();
this.info(`DeviceConfigure successful ${device.ieeeAddr} ${device.modelID}`);
}
} catch (error) {
this.sendError(error);
this.error(
Expand Down

0 comments on commit 0680723

Please sign in to comment.