Commit 09ed69a568e11ffe853e63e0c110199b88995b7c

Authored by Igor Kulikov
Committed by GitHub
2 parents 4c4ec36b 3e28c960

Merge pull request #3885 from vvlladd28/bug/bulk-import/updated-type-device

UI: Fixed updated deviceProfile in bulk import devices
... ... @@ -869,7 +869,7 @@ export class EntityService {
869 869 return findEntityObservable.pipe(
870 870 mergeMap((entity) => {
871 871 const tasks: Observable<any>[] = [];
872   - const result: Device | Asset = entity as (Device | Asset);
  872 + const result: Device & Asset = entity as (Device | Asset);
873 873 const additionalInfo = result.additionalInfo || {};
874 874 if (result.label !== entityData.label ||
875 875 result.type !== entityData.type ||
... ... @@ -882,6 +882,9 @@ export class EntityService {
882 882 if (result.id.entityType === EntityType.DEVICE) {
883 883 result.additionalInfo.gateway = entityData.gateway;
884 884 }
  885 + if (result.id.entityType === EntityType.DEVICE && result.deviceProfileId) {
  886 + delete result.deviceProfileId;
  887 + }
885 888 switch (result.id.entityType) {
886 889 case EntityType.DEVICE:
887 890 tasks.push(this.deviceService.saveDevice(result, config));
... ...