async function poll(device) {
  const deviceId = parseExternalId(device.external_id);
  const devices = await this.gladys.device.get({ service: 'tp-link' });
  const internalDevice = devices.find((d) => d.external_id === device.external_id);
  if (!internalDevice) {
    throw new NotFoundError(`TP_LINK_DEVICE_NOT_FOUND`);
  }

  const deviceIp = internalDevice.params.find((p) => p.name === TP_LINK_IP_ADDRESS).value;
  const tpLinkDevice = await this.client.getDevice({ host: deviceIp });
  const deviceSysInfo = await tpLinkDevice.getSysInfo();
  const type = deviceSysInfo.type ? deviceSysInfo.type : deviceSysInfo.mic_type;
  switch (type) {
    case 'IOT.SMARTPLUGSWITCH':
    case 'IOT.RANGEEXTENDER.SMARTPLUG':
      pollAndCompareStateForPlug(this, device, deviceSysInfo, deviceId);
      break;
    case 'IOT.SMARTBULB':
      pollAndCompareStateForBulb(this, device, deviceSysInfo, deviceId);
      break;
    default:
      logger.error(`Polling TP-Link Device ${deviceId} - not managed`);
      throw new NotFoundError(`TP_LINK_DEVICE_NOT_MANAGED`);
  }
}
@description Poll value of a TP-Link Device.
@param {object} device - The device to control.
@returns {Promise} Promise.
@example
poll(device);