From 3e28c960d3be57fcd9adfce1f6625ff35d81edb7 Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Tue, 22 Dec 2020 13:40:02 +0200 Subject: [PATCH] UI: Fixed updated deviceProfile in bulk import devices --- ui-ngx/src/app/core/http/entity.service.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/core/http/entity.service.ts b/ui-ngx/src/app/core/http/entity.service.ts index 9263838ffa..6a1f0191c4 100644 --- a/ui-ngx/src/app/core/http/entity.service.ts +++ b/ui-ngx/src/app/core/http/entity.service.ts @@ -869,7 +869,7 @@ export class EntityService { return findEntityObservable.pipe( mergeMap((entity) => { const tasks: Observable[] = []; - const result: Device | Asset = entity as (Device | Asset); + const result: Device & Asset = entity as (Device | Asset); const additionalInfo = result.additionalInfo || {}; if (result.label !== entityData.label || result.type !== entityData.type || @@ -882,6 +882,9 @@ export class EntityService { if (result.id.entityType === EntityType.DEVICE) { result.additionalInfo.gateway = entityData.gateway; } + if (result.id.entityType === EntityType.DEVICE && result.deviceProfileId) { + delete result.deviceProfileId; + } switch (result.id.entityType) { case EntityType.DEVICE: tasks.push(this.deviceService.saveDevice(result, config));