Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
884 B
1
Indexable
Never
// Manage case where Zigbee USB Dongle Path has changed by removing the container. It will be created with good config later
  if (dockerContainers.length > 0) {
    const containerDescription = await this.gladys.system.inspectContainer(container);
console.log(containerDescription.HostConfig.Devices);
    if (containerDescription.HostConfig.Devices[0].PathOnHost !== z2mDriverPath) {
      logger.info(
        `Zigbee2mqtt container with USB dongle path ${containerDescription.HostConfig.Devices[0].PathOnHost} should be removed (new USB dongle path ${z2mDriverPath} configured)...`,
      );
      await this.gladys.system.stopContainer(container.id);
      await this.gladys.system.removeContainer(container.id);

      creationNeeded = true;
    }
  }


const containerTmp = this.dockerode.getContainer(container.id);
  const containerDescription = await containerTmp.inspect();